Cosmetic changes: applies changes suggested by static analysis

This commit is contained in:
Felipe Zimmerle
2016-07-12 00:46:12 -03:00
parent 247f24c5bb
commit 4078677b7f
26 changed files with 139 additions and 122 deletions

View File

@@ -11,6 +11,8 @@ unusedFunction:test/optimization/optimization.cc
unusedFunction:src/utils.cc
*:src/parser/seclang-parser.hh
*:src/parser/seclang-scanner.cc
*:parser/seclang-parser.hh
*:parser/seclang-scanner.cc
*:others/libinjection/src/libinjection_html5.c
*:others/libinjection/src/libinjection_sqli.c
*:others/libinjection/src/libinjection_xss.c
@@ -20,5 +22,16 @@ unusedFunction:src/utils.cc
*:others/libinjection/src/test_speed_sqli.c
*:others/libinjection/src/test_speed_xss.c
*:others/libinjection/src/testdriver.c
initializerList:src/actions/action.h:90
initializerList:src/actions/action.h:91
unusedLabel:src/unique_id.cc:222
unusedLabel:src/unique_id.cc:224
leakReturnValNotUsed:src/debug_log_writer_agent.cc:31
postfixOperator:*
*:src/utils/mbedtls/base64.c
*:src/utils/mbedtls/sha1.c
readdirCalled:test/common/modsecurity_test.cc:114
missingInclude:*
unreadVariable:test/regression/regression.cc:380
shiftNegative:src/utils/msc_tree.cc
nullPointerRedundantCheck::src/utils/msc_tree.cc

View File

@@ -55,6 +55,7 @@ int main(int argc, char **argv) {
if (modsecRules->loadFromUri(x.c_str()) < 0) {
std::cout << "Not able to load the rules" << std::endl;
std::cout << modsecRules->getParserError() << std::endl;
delete modsecRules;
return -1;
}
}
@@ -145,7 +146,7 @@ int main(int argc, char **argv) {
std::cout << std::endl;
std::cout << std::endl;
delete modsecRules;
return 0;
}

View File

@@ -310,7 +310,9 @@ void perform_unit_test(ModSecurityTest<RegressionTest> *test,
}
#endif
#if 0
end:
#endif
modsec_transaction->processLogging();
CustomDebugLog *d = reinterpret_cast<CustomDebugLog *>
@@ -416,7 +418,7 @@ int main(int argc, char **argv) {
for (std::string &a : keyList) {
test_number++;
if ((test.m_test_number == 0)
|| (test.m_test_number != 0 && test_number == test.m_test_number)) {
|| (test_number == test.m_test_number)) {
std::vector<RegressionTest *> *tests = test[a];
perform_unit_test(&test, tests, &res, &counter);
}