mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Inline cppcheck suppressions
This commit is contained in:
@@ -32,6 +32,7 @@ class GeoLookup : public Operator {
|
||||
bool evaluate(Transaction *transaction, const std::string &exp) override;
|
||||
|
||||
protected:
|
||||
// cppcheck-suppress functionStatic
|
||||
bool debug(Transaction *transaction, int x, const std::string &a) {
|
||||
ms_dbg_a(transaction, x, a);
|
||||
return true;
|
||||
|
@@ -66,10 +66,11 @@ class Rbl : public Operator {
|
||||
m_demandsPassword(false),
|
||||
m_provider(RblProvider::UnknownProvider),
|
||||
Operator("Rbl", std::move(param)) {
|
||||
m_service = m_string->evaluate();
|
||||
if (m_service.find("httpbl.org") != std::string::npos) {
|
||||
m_demandsPassword = true;
|
||||
m_provider = RblProvider::httpbl;
|
||||
m_service = m_string->evaluate(); // cppcheck-suppress useInitializationList
|
||||
if (m_service.find("httpbl.org") != std::string::npos)
|
||||
{
|
||||
m_demandsPassword = true;
|
||||
m_provider = RblProvider::httpbl;
|
||||
} else if (m_service.find("uribl.com") != std::string::npos) {
|
||||
m_provider = RblProvider::uribl;
|
||||
} else if (m_service.find("spamhaus.org") != std::string::npos) {
|
||||
|
@@ -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);
|
||||
|
@@ -74,7 +74,7 @@ bool VerifyCPF::verify(const char *cpfnumber, int len) {
|
||||
c = cpf_len;
|
||||
|
||||
for (i = 0; i < 9; i++) {
|
||||
sum += (cpf[i] * --c);
|
||||
sum += (cpf[i] * --c); // cppcheck-suppress uninitvar
|
||||
}
|
||||
|
||||
factor = (sum % cpf_len);
|
||||
|
@@ -64,7 +64,7 @@ bool VerifySVNR::verify(const char *svnrnumber, int len) {
|
||||
}
|
||||
//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;
|
||||
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 %= 11;
|
||||
if(sum == 10){
|
||||
sum = 0;
|
||||
@@ -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++) {
|
||||
|
Reference in New Issue
Block a user