Added missing override keyword as reported by cppcheck 2.14

This commit is contained in:
Eduardo Arias 2024-04-28 22:25:17 -03:00 committed by Eduardo Arias
parent 1eed8b9288
commit da38f20e19
12 changed files with 16 additions and 37 deletions

View File

@ -31,10 +31,7 @@ namespace actions {
class Exec : public Action {
public:
explicit Exec(const std::string &action)
: Action(action),
m_script("") { }
~Exec() { }
: Action(action) { }
bool evaluate(RuleWithActions *rule, Transaction *transaction) override;
bool init(std::string *error) override;

View File

@ -74,7 +74,7 @@ class InMemoryPerProcess :
public Collection {
public:
explicit InMemoryPerProcess(const std::string &name);
~InMemoryPerProcess();
~InMemoryPerProcess() override;
void store(const std::string &key, const std::string &value);
bool storeOrUpdateFirst(const std::string &key,

View File

@ -42,7 +42,7 @@ class FuzzyHash : public Operator {
: Operator("FuzzyHash", std::move(param)),
m_threshold(0),
m_head(NULL) { }
~FuzzyHash();
~FuzzyHash() override;
bool evaluate(Transaction *transaction, const std::string &std) override;

View File

@ -40,7 +40,7 @@ class Pm : public Operator {
: Operator(n, std::move(param)) {
m_p = acmp_create(0);
}
~Pm();
~Pm() override;
bool evaluate(Transaction *transaction, RuleWithActions *rule,
const std::string &str,
RuleMessage &ruleMessage) override;

View File

@ -42,7 +42,7 @@ class Rx : public Operator {
m_couldContainsMacro = true;
}
~Rx() {
~Rx() override {
if (m_string->m_containsMacro == false && m_re != NULL) {
delete m_re;
m_re = NULL;

View File

@ -42,7 +42,7 @@ class RxGlobal : public Operator {
m_couldContainsMacro = true;
}
~RxGlobal() {
~RxGlobal() override {
if (m_string->m_containsMacro == false && m_re != NULL) {
delete m_re;
m_re = NULL;

View File

@ -57,8 +57,6 @@ class ValidateDTD : public Operator {
explicit ValidateDTD(std::unique_ptr<RunTimeString> param)
: Operator("ValidateDTD", std::move(param)) { }
#ifdef WITH_LIBXML2
~ValidateDTD() { }
bool evaluate(Transaction *transaction, const std::string &str) override;
bool init(const std::string &file, std::string *error) override;

View File

@ -38,7 +38,6 @@ class ValidateSchema : public Operator {
/** @ingroup ModSecurity_Operator */
explicit ValidateSchema(std::unique_ptr<RunTimeString> param)
: Operator("ValidateSchema", std::move(param)) { }
~ValidateSchema() { }
#ifdef WITH_LIBXML2
bool evaluate(Transaction *transaction, const std::string &str) override;

View File

@ -45,7 +45,7 @@ class VerifyCC : public Operator {
m_pc(NULL),
m_pce(NULL) { }
#endif
~VerifyCC();
~VerifyCC() override;
bool evaluate(Transaction *t, RuleWithActions *rule,
const std::string& input,

View File

@ -35,13 +35,8 @@ class VerifyCPF : public Operator {
public:
/** @ingroup ModSecurity_Operator */
explicit VerifyCPF(std::unique_ptr<RunTimeString> param)
: Operator("VerifyCPF", std::move(param)) {
m_re = new Regex(m_param);
}
~VerifyCPF() {
delete m_re;
}
: Operator("VerifyCPF", std::move(param))
, m_re(std::make_unique<Regex>(m_param)) { }
bool operator=(const VerifyCPF &a) = delete;
VerifyCPF(const VerifyCPF &a) = delete;
@ -54,7 +49,7 @@ class VerifyCPF : public Operator {
private:
static int convert_to_int(const char c);
Regex *m_re;
std::unique_ptr<Regex> m_re;
const char bad_cpf[12][12] = { "00000000000",
"01234567890",
"11111111111",

View File

@ -35,13 +35,8 @@ class VerifySSN : public Operator {
public:
/** @ingroup ModSecurity_Operator */
explicit VerifySSN(std::unique_ptr<RunTimeString> param)
: Operator("VerifySSN", std::move(param)) {
m_re = new Regex(m_param);
}
~VerifySSN() {
delete m_re;
}
: Operator("VerifySSN", std::move(param))
, m_re(std::make_unique<Regex>(m_param)) { }
bool operator=(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 int convert_to_int(const char c);
Regex *m_re;
std::unique_ptr<Regex> m_re;
};
} // namespace operators

View File

@ -21,13 +21,8 @@ class VerifySVNR : public Operator {
public:
/** @ingroup ModSecurity_Operator */
explicit VerifySVNR(std::unique_ptr<RunTimeString> param)
: Operator("VerifySVNR", std::move(param)) {
m_re = new Regex(m_param);
}
~VerifySVNR() {
delete m_re;
}
: Operator("VerifySVNR", std::move(param))
, m_re(std::make_unique<Regex>(m_param)) { }
bool operator=(const VerifySVNR &a) = delete;
VerifySVNR(const VerifySVNR &a) = delete;
@ -39,7 +34,7 @@ class VerifySVNR : public Operator {
bool verify(const char *ssnumber, int len);
private:
Regex *m_re;
std::unique_ptr<Regex> m_re;
static int convert_to_int(const char c);
const char bad_svnr[12][11] = { "0000000000",
"0123456789",