Skip to content

Commit

Permalink
temporarily remove all inline cppcheck suppressions to check which ar…
Browse files Browse the repository at this point in the history
…e still necessary.
  • Loading branch information
eduar-hte committed Oct 21, 2024
1 parent 7ec94ef commit cea27fd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion headers/modsecurity/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class Transaction : public TransactionAnchoredVariables, public TransactionSecMa
size_t getRequestBodyLength();

#ifndef NO_LOGS
void debug(int, const std::string &) const; // cppcheck-suppress functionStatic
void debug(int, const std::string &) const;
#endif
void serverLog(const RuleMessage &rm);

Expand Down
3 changes: 1 addition & 2 deletions src/compat/msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#define pclose _pclose

inline tm* localtime_r(const time_t* tin, tm* tout) {
// cppcheck-suppress[uninitvar, ctuuninitvar]
if (!localtime_s(tout, tin)) return tout;
if (!localtime_s(tout, tin)) return tout; // cppcheck-suppress[uninitvar, ctuuninitvar]

return nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions src/engine/lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class Lua {
public:
Lua() { }

bool load(const std::string &script, std::string *err); // cppcheck-suppress functionStatic ; triggered when compiling without LUA
int run(Transaction *t, const std::string &str = ""); // cppcheck-suppress functionStatic ; triggered when compiling without LUA
bool load(const std::string &script, std::string *err);
int run(Transaction *t, const std::string &str = "");
static bool isCompatible(const std::string &script, Lua *l, std::string *error);

#ifdef WITH_LUA
Expand Down
1 change: 0 additions & 1 deletion src/operators/geo_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class GeoLookup : public Operator {
bool evaluate(Transaction *transaction, const std::string &exp) override;

protected:
// cppcheck-suppress functionStatic
bool debug(const Transaction *transaction, int x, const std::string &a) {
ms_dbg_a(transaction, x, a);
return true;
Expand Down
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; // cppcheck-suppress knownConditionTrueFalse
return res;
}

int rc = validate_url_encoding(input.c_str(), input.size(), &offset);
Expand Down
2 changes: 1 addition & 1 deletion src/operators/verify_cpf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool VerifyCPF::verify(const char *cpfnumber, int len) const {
c = cpf_len;

for (i = 0; i < 9; i++) {
sum += (cpf[i] * --c); // cppcheck-suppress uninitvar
sum += (cpf[i] * --c);
}

factor = (sum % cpf_len);
Expand Down
4 changes: 2 additions & 2 deletions src/operators/verify_svnr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bool VerifySVNR::verify(const char *svnrnumber, int len) const {
}
//Laufnummer mit 3, 7, 9
//Geburtsdatum mit 5, 8, 4, 2, 1, 6
sum = svnr[0] * 3 + svnr[1] * 7 + svnr[2] * 9 + svnr[4] * 5 + svnr[5] * 8 + svnr[6] * 4 + svnr[7] * 2 + svnr[8] * 1 + svnr[9] * 6; // cppcheck-suppress uninitvar
sum = svnr[0] * 3 + svnr[1] * 7 + svnr[2] * 9 + svnr[4] * 5 + svnr[5] * 8 + svnr[6] * 4 + svnr[7] * 2 + svnr[8] * 1 + svnr[9] * 6;
sum %= 11;
if(sum == 10){
sum = 0;
Expand All @@ -84,7 +84,7 @@ bool VerifySVNR::evaluate(Transaction *t, RuleWithActions *rule,
int i;

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

for (i = 0; i < input.size() - 1 && is_svnr == false; i++) {
Expand Down

0 comments on commit cea27fd

Please sign in to comment.