security: renamed classes
This commit is contained in:
parent
b826d2e41b
commit
5269e38ae2
4
Makefile
4
Makefile
|
@ -120,7 +120,7 @@ src/checkmemoryleak.o: src/checkmemoryleak.cpp src/checkmemoryleak.h src/tokeniz
|
||||||
src/checkother.o: src/checkother.cpp src/checkother.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
src/checkother.o: src/checkother.cpp src/checkother.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
||||||
g++ $(CXXFLAGS) -c -o src/checkother.o src/checkother.cpp
|
g++ $(CXXFLAGS) -c -o src/checkother.o src/checkother.cpp
|
||||||
|
|
||||||
src/checksecurity.o: src/checksecurity.cpp src/errorlogger.h src/settings.h src/token.h src/tokenize.h
|
src/checksecurity.o: src/checksecurity.cpp src/checksecurity.h src/errorlogger.h src/settings.h src/token.h src/tokenize.h
|
||||||
g++ $(CXXFLAGS) -c -o src/checksecurity.o src/checksecurity.cpp
|
g++ $(CXXFLAGS) -c -o src/checksecurity.o src/checksecurity.cpp
|
||||||
|
|
||||||
src/checkstl.o: src/checkstl.cpp src/checkstl.h src/errorlogger.h src/settings.h src/token.h src/tokenize.h
|
src/checkstl.o: src/checkstl.cpp src/checkstl.h src/errorlogger.h src/settings.h src/token.h src/tokenize.h
|
||||||
|
@ -204,7 +204,7 @@ test/testredundantif.o: test/testredundantif.cpp src/tokenize.h src/settings.h s
|
||||||
test/testrunner.o: test/testrunner.cpp test/testsuite.h src/errorlogger.h src/settings.h
|
test/testrunner.o: test/testrunner.cpp test/testsuite.h src/errorlogger.h src/settings.h
|
||||||
g++ $(CXXFLAGS) -c -o test/testrunner.o test/testrunner.cpp
|
g++ $(CXXFLAGS) -c -o test/testrunner.o test/testrunner.cpp
|
||||||
|
|
||||||
test/testsecurity.o: test/testsecurity.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h test/testsuite.h
|
test/testsecurity.o: test/testsecurity.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checksecurity.h test/testsuite.h
|
||||||
g++ $(CXXFLAGS) -c -o test/testsecurity.o test/testsecurity.cpp
|
g++ $(CXXFLAGS) -c -o test/testsecurity.o test/testsecurity.cpp
|
||||||
|
|
||||||
test/testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h
|
test/testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h
|
||||||
|
|
|
@ -17,19 +17,19 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/
|
* along with this program. If not, see <http://www.gnu.org/licenses/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "checkvalidate.h"
|
#include "checksecurity.h"
|
||||||
#include "errorlogger.h"
|
#include "errorlogger.h"
|
||||||
#include "token.h"
|
#include "token.h"
|
||||||
#include "tokenize.h"
|
#include "tokenize.h"
|
||||||
|
|
||||||
|
|
||||||
CheckValidate::CheckValidate(const Tokenizer *tokenizer, ErrorLogger *errorLogger)
|
CheckSecurity::CheckSecurity(const Tokenizer *tokenizer, ErrorLogger *errorLogger)
|
||||||
: _tokenizer(tokenizer), _errorLogger(errorLogger)
|
: _tokenizer(tokenizer), _errorLogger(errorLogger)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckValidate::~CheckValidate()
|
CheckSecurity::~CheckSecurity()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ CheckValidate::~CheckValidate()
|
||||||
/**
|
/**
|
||||||
* Check that there are input validation when reading number from FILE/stream
|
* Check that there are input validation when reading number from FILE/stream
|
||||||
*/
|
*/
|
||||||
void CheckValidate::readnum()
|
void CheckSecurity::readnum()
|
||||||
{
|
{
|
||||||
const Token *tok = _tokenizer->tokens();
|
const Token *tok = _tokenizer->tokens();
|
||||||
while (tok)
|
while (tok)
|
||||||
|
@ -80,7 +80,7 @@ void CheckValidate::readnum()
|
||||||
* Read data from Form/GUI
|
* Read data from Form/GUI
|
||||||
* Todo: This function must be more customizable to be usable
|
* Todo: This function must be more customizable to be usable
|
||||||
*/
|
*/
|
||||||
void CheckValidate::gui()
|
void CheckSecurity::gui()
|
||||||
{
|
{
|
||||||
// input control classes whose values are insecure..
|
// input control classes whose values are insecure..
|
||||||
const char *inputclass[] = {"TEdit", 0};
|
const char *inputclass[] = {"TEdit", 0};
|
||||||
|
|
|
@ -19,19 +19,19 @@
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#ifndef checkvalidateH
|
#ifndef checksecurityH
|
||||||
#define checkvalidateH
|
#define checksecurityH
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
class ErrorLogger;
|
class ErrorLogger;
|
||||||
class Token;
|
class Token;
|
||||||
class Tokenizer;
|
class Tokenizer;
|
||||||
|
|
||||||
class CheckValidate
|
class CheckSecurity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CheckValidate(const Tokenizer *tokenizer, ErrorLogger *errorLogger);
|
CheckSecurity(const Tokenizer *tokenizer, ErrorLogger *errorLogger);
|
||||||
~CheckValidate();
|
~CheckSecurity();
|
||||||
|
|
||||||
/** Reading a number from a stream/FILE */
|
/** Reading a number from a stream/FILE */
|
||||||
void readnum();
|
void readnum();
|
||||||
|
|
|
@ -20,16 +20,16 @@
|
||||||
|
|
||||||
|
|
||||||
#include "../src/tokenize.h"
|
#include "../src/tokenize.h"
|
||||||
#include "../src/checkvalidate.h"
|
#include "../src/checksecurity.h"
|
||||||
#include "testsuite.h"
|
#include "testsuite.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
extern std::ostringstream errout;
|
extern std::ostringstream errout;
|
||||||
|
|
||||||
class TestValidate : public TestFixture
|
class TestSecurity : public TestFixture
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TestValidate() : TestFixture("TestValidate")
|
TestSecurity() : TestFixture("TestSecurity")
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -52,8 +52,8 @@ private:
|
||||||
errout.str("");
|
errout.str("");
|
||||||
|
|
||||||
// Check char variable usage..
|
// Check char variable usage..
|
||||||
CheckValidate checkValidate(&tokenizer, this);
|
CheckSecurity checkSecurity(&tokenizer, this);
|
||||||
checkValidate.readnum();
|
checkSecurity.readnum();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,8 +83,8 @@ private:
|
||||||
errout.str("");
|
errout.str("");
|
||||||
|
|
||||||
// Check char variable usage..
|
// Check char variable usage..
|
||||||
CheckValidate checkValidate(&tokenizer, this);
|
CheckSecurity checkSecurity(&tokenizer, this);
|
||||||
checkValidate.gui();
|
checkSecurity.gui();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,4 +100,4 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
REGISTER_TEST(TestValidate)
|
REGISTER_TEST(TestSecurity)
|
||||||
|
|
Loading…
Reference in New Issue