Skip to content

Commit ae3ad5e

Browse files
committed
cosmetics: Address some cppcheck complains
1 parent 51d06d7 commit ae3ad5e

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/operators/detect_sqli.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bool DetectSQLi::evaluate(Transaction *t, RuleWithActions *rule,
3838
ms_dbg_a(t, 4, "detected SQLi using libinjection with " \
3939
"fingerprint '" + std::string(fingerprint) + "' at: '" +
4040
input + "'");
41-
if (rule && t && rule->hasCaptureAction()) {
41+
if (rule && rule->hasCaptureAction()) {
4242
t->m_collections.m_tx_collection->storeOrUpdateFirst(
4343
"0", std::string(fingerprint));
4444
ms_dbg_a(t, 7, "Added DetectSQLi match TX.0: " + \

src/operators/detect_xss.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bool DetectXSS::evaluate(Transaction *t, RuleWithActions *rule,
3434
if (t) {
3535
if (is_xss) {
3636
ms_dbg_a(t, 5, "detected XSS using libinjection.");
37-
if (rule && t && rule->hasCaptureAction()) {
37+
if (rule && rule->hasCaptureAction()) {
3838
t->m_collections.m_tx_collection->storeOrUpdateFirst(
3939
"0", std::string(input));
4040
ms_dbg_a(t, 7, "Added DetectXSS match TX.0: " + \

src/operators/verify_cc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ bool VerifyCC::evaluate(Transaction *t, RuleWithActions *rule,
141141
int is_cc = luhnVerify(match.c_str(), match.size());
142142
if (is_cc) {
143143
if (t) {
144-
if (rule && t && rule->hasCaptureAction()) {
144+
if (rule && rule->hasCaptureAction()) {
145145
t->m_collections.m_tx_collection->storeOrUpdateFirst(
146146
"0", std::string(match));
147147
ms_dbg_a(t, 7, "Added VerifyCC match TX.0: " + \

src/rule_with_operator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ RuleWithOperator::RuleWithOperator(Operator *op,
5858
std::unique_ptr<std::string> fileName,
5959
int lineNumber)
6060
: RuleWithActions(actions, transformations, std::move(fileName), lineNumber),
61-
m_operator(op),
62-
m_variables(_variables) { /* */ }
61+
m_variables(_variables),
62+
m_operator(op) { /* */ }
6363

6464

6565
RuleWithOperator::~RuleWithOperator() {

src/rules_set.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace modsecurity {
5050
int RulesSet::loadFromUri(const char *uri) {
5151
Driver *driver = new Driver();
5252

53-
if (driver->parseFile(uri) == false) {
53+
if (driver->parseFile(uri) == 0) {
5454
m_parserError << driver->m_parserError.str();
5555
delete driver;
5656
return -1;
@@ -66,7 +66,7 @@ int RulesSet::loadFromUri(const char *uri) {
6666
int RulesSet::load(const char *file, const std::string &ref) {
6767
Driver *driver = new Driver();
6868

69-
if (driver->parse(file, ref) == false) {
69+
if (driver->parse(file, ref) == 0) {
7070
m_parserError << driver->m_parserError.str();
7171
delete driver;
7272
return -1;

0 commit comments

Comments
 (0)