diff --git a/src/operators/detect_sqli.cc b/src/operators/detect_sqli.cc index f2032c6d..16f31c18 100644 --- a/src/operators/detect_sqli.cc +++ b/src/operators/detect_sqli.cc @@ -38,7 +38,7 @@ bool DetectSQLi::evaluate(Transaction *t, RuleWithActions *rule, ms_dbg_a(t, 4, "detected SQLi using libinjection with " \ "fingerprint '" + std::string(fingerprint) + "' at: '" + input + "'"); - if (rule && t && rule->hasCaptureAction()) { + if (rule && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( "0", std::string(fingerprint)); ms_dbg_a(t, 7, "Added DetectSQLi match TX.0: " + \ diff --git a/src/operators/detect_xss.cc b/src/operators/detect_xss.cc index 859c20f8..7386f365 100644 --- a/src/operators/detect_xss.cc +++ b/src/operators/detect_xss.cc @@ -34,7 +34,7 @@ bool DetectXSS::evaluate(Transaction *t, RuleWithActions *rule, if (t) { if (is_xss) { ms_dbg_a(t, 5, "detected XSS using libinjection."); - if (rule && t && rule->hasCaptureAction()) { + if (rule && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( "0", std::string(input)); ms_dbg_a(t, 7, "Added DetectXSS match TX.0: " + \ diff --git a/src/operators/verify_cc.cc b/src/operators/verify_cc.cc index f23c7a1f..2976bd28 100644 --- a/src/operators/verify_cc.cc +++ b/src/operators/verify_cc.cc @@ -141,7 +141,7 @@ bool VerifyCC::evaluate(Transaction *t, RuleWithActions *rule, int is_cc = luhnVerify(match.c_str(), match.size()); if (is_cc) { if (t) { - if (rule && t && rule->hasCaptureAction()) { + if (rule && rule->hasCaptureAction()) { t->m_collections.m_tx_collection->storeOrUpdateFirst( "0", std::string(match)); ms_dbg_a(t, 7, "Added VerifyCC match TX.0: " + \ diff --git a/src/rule_with_operator.cc b/src/rule_with_operator.cc index e4ab6a57..9e8305b9 100644 --- a/src/rule_with_operator.cc +++ b/src/rule_with_operator.cc @@ -58,8 +58,8 @@ RuleWithOperator::RuleWithOperator(Operator *op, std::unique_ptr fileName, int lineNumber) : RuleWithActions(actions, transformations, std::move(fileName), lineNumber), - m_operator(op), - m_variables(_variables) { /* */ } + m_variables(_variables), + m_operator(op) { /* */ } RuleWithOperator::~RuleWithOperator() { diff --git a/src/rules_set.cc b/src/rules_set.cc index 89b2745b..11f25e9a 100644 --- a/src/rules_set.cc +++ b/src/rules_set.cc @@ -50,7 +50,7 @@ namespace modsecurity { int RulesSet::loadFromUri(const char *uri) { Driver *driver = new Driver(); - if (driver->parseFile(uri) == false) { + if (driver->parseFile(uri) == 0) { m_parserError << driver->m_parserError.str(); delete driver; return -1; @@ -66,7 +66,7 @@ int RulesSet::loadFromUri(const char *uri) { int RulesSet::load(const char *file, const std::string &ref) { Driver *driver = new Driver(); - if (driver->parse(file, ref) == false) { + if (driver->parse(file, ref) == 0) { m_parserError << driver->m_parserError.str(); delete driver; return -1;