diff --git a/src/engine/lua.h b/src/engine/lua.h index 37a150b0ef..967a6fa896 100644 --- a/src/engine/lua.h +++ b/src/engine/lua.h @@ -36,6 +36,9 @@ class LuaScriptBlob { m_data(NULL), m_len(0) { } + LuaScriptBlob(const LuaScriptBlob&) = delete; + LuaScriptBlob& operator=(const LuaScriptBlob&) = delete; + ~LuaScriptBlob() { if (m_data) { free(m_data); diff --git a/src/operators/pm.h b/src/operators/pm.h index 3ac1ffec7f..19e581fa67 100644 --- a/src/operators/pm.h +++ b/src/operators/pm.h @@ -40,6 +40,10 @@ class Pm : public Operator { : Operator(n, std::move(param)) { m_p = acmp_create(0); } + + Pm(const Pm&) = delete; + Pm& operator=(const Pm&) = delete; + ~Pm() override; bool evaluate(Transaction *transaction, RuleWithActions *rule, const std::string &str, diff --git a/src/operators/rx.h b/src/operators/rx.h index bc08969005..03d33700cd 100644 --- a/src/operators/rx.h +++ b/src/operators/rx.h @@ -42,6 +42,9 @@ class Rx : public Operator { m_couldContainsMacro = true; } + Rx(const Rx&) = delete; + Rx& operator=(const Rx&) = delete; + ~Rx() override { if (m_string->m_containsMacro == false && m_re != NULL) { delete m_re; diff --git a/src/operators/rx_global.h b/src/operators/rx_global.h index 82684eea28..e41ff2781d 100644 --- a/src/operators/rx_global.h +++ b/src/operators/rx_global.h @@ -42,6 +42,9 @@ class RxGlobal : public Operator { m_couldContainsMacro = true; } + RxGlobal(const RxGlobal&) = delete; + RxGlobal& operator=(const RxGlobal&) = delete; + ~RxGlobal() override { if (m_string->m_containsMacro == false && m_re != NULL) { delete m_re; diff --git a/src/request_body_processor/multipart.h b/src/request_body_processor/multipart.h index bfada4b979..08d4ffe920 100644 --- a/src/request_body_processor/multipart.h +++ b/src/request_body_processor/multipart.h @@ -150,6 +150,10 @@ class MultipartPart { class Multipart { public: Multipart(const std::string &header, Transaction *transaction); + + Multipart(const Multipart&) = delete; + Multipart& operator=(const Multipart&) = delete; + ~Multipart(); bool init(std::string *err); diff --git a/src/utils/ip_tree.h b/src/utils/ip_tree.h index ea560acb19..d4ef274060 100644 --- a/src/utils/ip_tree.h +++ b/src/utils/ip_tree.h @@ -31,6 +31,8 @@ namespace Utils { class IpTree { public: IpTree(); + IpTree(const IpTree&) = delete; + IpTree& operator=(const IpTree&) = delete; ~IpTree(); bool contains(const std::string &ip); diff --git a/src/variables/rule.h b/src/variables/rule.h index eed98c8ae9..7142f71951 100644 --- a/src/variables/rule.h +++ b/src/variables/rule.h @@ -38,9 +38,9 @@ class Rule_DictElement : public VariableDictElement { \ : VariableDictElement(m_rule, dictElement) { } static void id(Transaction *t, - RuleWithActions *rule, + const RuleWithActions *rule, std::vector *l) { - RuleWithActions *r = rule; + const RuleWithActions *r = rule; while (r && r->m_ruleId == 0) { r = r->m_chainedRuleParent; @@ -72,9 +72,9 @@ class Rule_DictElement : public VariableDictElement { \ static void severity(Transaction *t, - RuleWithActions *rule, + const RuleWithActions *rule, std::vector *l) { - RuleWithActions *r = rule; + const RuleWithActions *r = rule; while (r && !r->hasSeverity()) { r = r->m_chainedRuleParent;