Skip to content

Commit

Permalink
Inline cppcheck suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
eduar-hte committed Apr 28, 2024
1 parent bf18699 commit 40fbc98
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/operators/validate_url_encoding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool ValidateUrlEncoding::evaluate(Transaction *transaction, RuleWithActions *ru
bool res = false;

if (input.empty() == true) {
return res;
return res; // cppcheck-suppress knownConditionTrueFalse
}

int rc = validate_url_encoding(input.c_str(), input.size(), &offset);
Expand Down
2 changes: 1 addition & 1 deletion src/operators/verify_svnr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool VerifySVNR::evaluate(Transaction *t, RuleWithActions *rule,
int i;

if (m_param.empty()) {
return is_svnr;
return is_svnr; // cppcheck-suppress knownConditionTrueFalse
}

for (i = 0; i < input.size() - 1 && is_svnr == false; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/rules_set_properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ void ConfigUnicodeMap::loadConfig(std::string f, double configCodePage,

if (mapping != NULL) {
ucode = strtok_r(mapping, ":", &hmap);
sscanf(ucode, "%x", &code);
sscanf(hmap, "%x", &Map);
sscanf(ucode, "%x", &code); // cppcheck-suppress invalidScanfArgType_int
sscanf(hmap, "%x", &Map); // cppcheck-suppress invalidScanfArgType_int
if (code >= 0 && code <= 65535) {
driver->m_unicodeMapTable.m_unicodeMapTable->change(code, Map);
}
Expand Down
4 changes: 0 additions & 4 deletions test/cppcheck_suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
shiftNegative:src/utils/msc_tree.cc
*:src/utils/acmp.cc
*:src/utils/msc_tree.cc
invalidScanfArgType_int:src/rules_set_properties.cc:105
invalidScanfArgType_int:src/rules_set_properties.cc:106


//
Expand All @@ -46,8 +44,6 @@ functionStatic:src/operators/geo_lookup.h:35
duplicateBreak:src/operators/validate_utf8_encoding.cc
syntaxError:src/transaction.cc:65
noConstructor:src/variables/variable.h:152
knownConditionTrueFalse:src/operators/validate_url_encoding.cc:77
knownConditionTrueFalse:src/operators/verify_svnr.cc:87
rethrowNoCurrentException:headers/modsecurity/transaction.h:313
rethrowNoCurrentException:src/rule_with_actions.cc:127
ctunullpointer:src/rule_with_actions.cc:242
Expand Down

0 comments on commit 40fbc98

Please sign in to comment.