Code cosmetics: reduce the amount of cppcheck warnings

This commit is contained in:
Felipe Zimmerle
2015-08-12 15:22:00 -03:00
parent 21400ba454
commit d5fe21ce3c
24 changed files with 49 additions and 56 deletions

View File

@@ -227,10 +227,10 @@ class Assay {
int getResponseBodyLenth();
std::list<std::pair<std::string, std::string>>
resolve_variable(std::string var);
std::string* resolve_variable_first(std::string);
std::string* resolve_variable_first(const std::string collectionName,
std::string var);
resolve_variable(const std::string& var);
std::string* resolve_variable_first(const std::string& key);
std::string* resolve_variable_first(const std::string& collectionName,
const std::string& var);
void store_variable(std::string, std::string value);
bool update_variable_first(std::string var, const std::string &value);

View File

@@ -47,6 +47,7 @@ class Rules : public RulesProperties {
Rules()
: debugLog(NULL),
RulesProperties(NULL),
m_referenceCount(0),
unicode_codepage(0) {
unicode_map_table = reinterpret_cast<int *>(
malloc(sizeof(int)*65536));
@@ -55,6 +56,7 @@ class Rules : public RulesProperties {
explicit Rules(DebugLog *customLog)
: debugLog(NULL),
m_referenceCount(0),
unicode_codepage(0),
RulesProperties(customLog) {
unicode_map_table = reinterpret_cast<int *>(

View File

@@ -45,8 +45,11 @@ class RulesProperties {
customDebugLog(NULL),
remoteRulesActionOnFailed(AbortOnFailedRemoteRulesAction),
requestBodyLimit(0),
secRequestBodyAccess(false),
secResponseBodyAccess(false),
requestBodyLimitAction(ProcessPartialBodyLimitAction),
responseBodyLimit(0),
debugLevel(0),
responseBodyLimitAction(ProcessPartialBodyLimitAction),
secRuleEngine(DetectionOnlyRuleEngine) { }
@@ -54,6 +57,9 @@ class RulesProperties {
: audit_log(NULL),
customDebugLog(customDebugLog),
remoteRulesActionOnFailed(AbortOnFailedRemoteRulesAction),
secRequestBodyAccess(false),
secResponseBodyAccess(false),
debugLevel(0),
requestBodyLimit(0),
requestBodyLimitAction(ProcessPartialBodyLimitAction),
responseBodyLimit(0),
@@ -157,14 +163,12 @@ class RulesProperties {
DebugLog *customDebugLog;
int sec_audit_type;
bool sec_audit_engine;
bool sec_request_body_access;
bool sec_response_body_access;
bool secRequestBodyAccess;
bool secResponseBodyAccess;
std::string audit_log_path;
std::string audit_log_parts;
std::string debug_log_path;
int debug_level;
int debugLevel;
std::list<std::string> components;