mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Added missing override keyword as reported by cppcheck 2.14
This commit is contained in:
parent
1eed8b9288
commit
da38f20e19
@ -31,10 +31,7 @@ namespace actions {
|
|||||||
class Exec : public Action {
|
class Exec : public Action {
|
||||||
public:
|
public:
|
||||||
explicit Exec(const std::string &action)
|
explicit Exec(const std::string &action)
|
||||||
: Action(action),
|
: Action(action) { }
|
||||||
m_script("") { }
|
|
||||||
|
|
||||||
~Exec() { }
|
|
||||||
|
|
||||||
bool evaluate(RuleWithActions *rule, Transaction *transaction) override;
|
bool evaluate(RuleWithActions *rule, Transaction *transaction) override;
|
||||||
bool init(std::string *error) override;
|
bool init(std::string *error) override;
|
||||||
|
@ -74,7 +74,7 @@ class InMemoryPerProcess :
|
|||||||
public Collection {
|
public Collection {
|
||||||
public:
|
public:
|
||||||
explicit InMemoryPerProcess(const std::string &name);
|
explicit InMemoryPerProcess(const std::string &name);
|
||||||
~InMemoryPerProcess();
|
~InMemoryPerProcess() override;
|
||||||
void store(const std::string &key, const std::string &value);
|
void store(const std::string &key, const std::string &value);
|
||||||
|
|
||||||
bool storeOrUpdateFirst(const std::string &key,
|
bool storeOrUpdateFirst(const std::string &key,
|
||||||
|
@ -42,7 +42,7 @@ class FuzzyHash : public Operator {
|
|||||||
: Operator("FuzzyHash", std::move(param)),
|
: Operator("FuzzyHash", std::move(param)),
|
||||||
m_threshold(0),
|
m_threshold(0),
|
||||||
m_head(NULL) { }
|
m_head(NULL) { }
|
||||||
~FuzzyHash();
|
~FuzzyHash() override;
|
||||||
|
|
||||||
bool evaluate(Transaction *transaction, const std::string &std) override;
|
bool evaluate(Transaction *transaction, const std::string &std) override;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class Pm : public Operator {
|
|||||||
: Operator(n, std::move(param)) {
|
: Operator(n, std::move(param)) {
|
||||||
m_p = acmp_create(0);
|
m_p = acmp_create(0);
|
||||||
}
|
}
|
||||||
~Pm();
|
~Pm() override;
|
||||||
bool evaluate(Transaction *transaction, RuleWithActions *rule,
|
bool evaluate(Transaction *transaction, RuleWithActions *rule,
|
||||||
const std::string &str,
|
const std::string &str,
|
||||||
RuleMessage &ruleMessage) override;
|
RuleMessage &ruleMessage) override;
|
||||||
|
@ -42,7 +42,7 @@ class Rx : public Operator {
|
|||||||
m_couldContainsMacro = true;
|
m_couldContainsMacro = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
~Rx() {
|
~Rx() override {
|
||||||
if (m_string->m_containsMacro == false && m_re != NULL) {
|
if (m_string->m_containsMacro == false && m_re != NULL) {
|
||||||
delete m_re;
|
delete m_re;
|
||||||
m_re = NULL;
|
m_re = NULL;
|
||||||
|
@ -42,7 +42,7 @@ class RxGlobal : public Operator {
|
|||||||
m_couldContainsMacro = true;
|
m_couldContainsMacro = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
~RxGlobal() {
|
~RxGlobal() override {
|
||||||
if (m_string->m_containsMacro == false && m_re != NULL) {
|
if (m_string->m_containsMacro == false && m_re != NULL) {
|
||||||
delete m_re;
|
delete m_re;
|
||||||
m_re = NULL;
|
m_re = NULL;
|
||||||
|
@ -57,8 +57,6 @@ class ValidateDTD : public Operator {
|
|||||||
explicit ValidateDTD(std::unique_ptr<RunTimeString> param)
|
explicit ValidateDTD(std::unique_ptr<RunTimeString> param)
|
||||||
: Operator("ValidateDTD", std::move(param)) { }
|
: Operator("ValidateDTD", std::move(param)) { }
|
||||||
#ifdef WITH_LIBXML2
|
#ifdef WITH_LIBXML2
|
||||||
~ValidateDTD() { }
|
|
||||||
|
|
||||||
bool evaluate(Transaction *transaction, const std::string &str) override;
|
bool evaluate(Transaction *transaction, const std::string &str) override;
|
||||||
bool init(const std::string &file, std::string *error) override;
|
bool init(const std::string &file, std::string *error) override;
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ class ValidateSchema : public Operator {
|
|||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
explicit ValidateSchema(std::unique_ptr<RunTimeString> param)
|
explicit ValidateSchema(std::unique_ptr<RunTimeString> param)
|
||||||
: Operator("ValidateSchema", std::move(param)) { }
|
: Operator("ValidateSchema", std::move(param)) { }
|
||||||
~ValidateSchema() { }
|
|
||||||
#ifdef WITH_LIBXML2
|
#ifdef WITH_LIBXML2
|
||||||
|
|
||||||
bool evaluate(Transaction *transaction, const std::string &str) override;
|
bool evaluate(Transaction *transaction, const std::string &str) override;
|
||||||
|
@ -45,7 +45,7 @@ class VerifyCC : public Operator {
|
|||||||
m_pc(NULL),
|
m_pc(NULL),
|
||||||
m_pce(NULL) { }
|
m_pce(NULL) { }
|
||||||
#endif
|
#endif
|
||||||
~VerifyCC();
|
~VerifyCC() override;
|
||||||
|
|
||||||
bool evaluate(Transaction *t, RuleWithActions *rule,
|
bool evaluate(Transaction *t, RuleWithActions *rule,
|
||||||
const std::string& input,
|
const std::string& input,
|
||||||
|
@ -35,13 +35,8 @@ class VerifyCPF : public Operator {
|
|||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
explicit VerifyCPF(std::unique_ptr<RunTimeString> param)
|
explicit VerifyCPF(std::unique_ptr<RunTimeString> param)
|
||||||
: Operator("VerifyCPF", std::move(param)) {
|
: Operator("VerifyCPF", std::move(param))
|
||||||
m_re = new Regex(m_param);
|
, m_re(std::make_unique<Regex>(m_param)) { }
|
||||||
}
|
|
||||||
|
|
||||||
~VerifyCPF() {
|
|
||||||
delete m_re;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator=(const VerifyCPF &a) = delete;
|
bool operator=(const VerifyCPF &a) = delete;
|
||||||
VerifyCPF(const VerifyCPF &a) = delete;
|
VerifyCPF(const VerifyCPF &a) = delete;
|
||||||
@ -54,7 +49,7 @@ class VerifyCPF : public Operator {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static int convert_to_int(const char c);
|
static int convert_to_int(const char c);
|
||||||
Regex *m_re;
|
std::unique_ptr<Regex> m_re;
|
||||||
const char bad_cpf[12][12] = { "00000000000",
|
const char bad_cpf[12][12] = { "00000000000",
|
||||||
"01234567890",
|
"01234567890",
|
||||||
"11111111111",
|
"11111111111",
|
||||||
|
@ -35,13 +35,8 @@ class VerifySSN : public Operator {
|
|||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
explicit VerifySSN(std::unique_ptr<RunTimeString> param)
|
explicit VerifySSN(std::unique_ptr<RunTimeString> param)
|
||||||
: Operator("VerifySSN", std::move(param)) {
|
: Operator("VerifySSN", std::move(param))
|
||||||
m_re = new Regex(m_param);
|
, m_re(std::make_unique<Regex>(m_param)) { }
|
||||||
}
|
|
||||||
|
|
||||||
~VerifySSN() {
|
|
||||||
delete m_re;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator=(const VerifySSN &a) = delete;
|
bool operator=(const VerifySSN &a) = delete;
|
||||||
VerifySSN(const VerifySSN &a) = delete;
|
VerifySSN(const VerifySSN &a) = delete;
|
||||||
@ -56,7 +51,7 @@ class VerifySSN : public Operator {
|
|||||||
static bool verify(const char *ssnumber, int len);
|
static bool verify(const char *ssnumber, int len);
|
||||||
static int convert_to_int(const char c);
|
static int convert_to_int(const char c);
|
||||||
|
|
||||||
Regex *m_re;
|
std::unique_ptr<Regex> m_re;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace operators
|
} // namespace operators
|
||||||
|
@ -21,13 +21,8 @@ class VerifySVNR : public Operator {
|
|||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
explicit VerifySVNR(std::unique_ptr<RunTimeString> param)
|
explicit VerifySVNR(std::unique_ptr<RunTimeString> param)
|
||||||
: Operator("VerifySVNR", std::move(param)) {
|
: Operator("VerifySVNR", std::move(param))
|
||||||
m_re = new Regex(m_param);
|
, m_re(std::make_unique<Regex>(m_param)) { }
|
||||||
}
|
|
||||||
|
|
||||||
~VerifySVNR() {
|
|
||||||
delete m_re;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator=(const VerifySVNR &a) = delete;
|
bool operator=(const VerifySVNR &a) = delete;
|
||||||
VerifySVNR(const VerifySVNR &a) = delete;
|
VerifySVNR(const VerifySVNR &a) = delete;
|
||||||
@ -39,7 +34,7 @@ class VerifySVNR : public Operator {
|
|||||||
bool verify(const char *ssnumber, int len);
|
bool verify(const char *ssnumber, int len);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Regex *m_re;
|
std::unique_ptr<Regex> m_re;
|
||||||
static int convert_to_int(const char c);
|
static int convert_to_int(const char c);
|
||||||
const char bad_svnr[12][11] = { "0000000000",
|
const char bad_svnr[12][11] = { "0000000000",
|
||||||
"0123456789",
|
"0123456789",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user