diff --git a/src/operators/contains.cc b/src/operators/contains.cc index 91de6d78..afcb31b4 100644 --- a/src/operators/contains.cc +++ b/src/operators/contains.cc @@ -26,7 +26,7 @@ bool Contains::evaluate(Transaction *transaction, const std::string &input) { std::string p = MacroExpansion::expand(param, transaction); bool contains = input.find(p) != std::string::npos; - if (contains) { + if (contains && transaction) { transaction->m_matched.push_back(p); } diff --git a/src/operators/pm.cc b/src/operators/pm.cc index 2a8a2f70..351429fe 100644 --- a/src/operators/pm.cc +++ b/src/operators/pm.cc @@ -77,7 +77,7 @@ bool Pm::evaluate(Transaction *transaction, const std::string &input) { const char *match = NULL; rc = acmp_process_quick(&pt, &match, input.c_str(), input.length()); - if (rc == 1) { + if (rc == 1 && transaction) { transaction->m_matched.push_back(std::string(match)); } diff --git a/src/operators/rx.cc b/src/operators/rx.cc index 1d13c882..59a561af 100644 --- a/src/operators/rx.cc +++ b/src/operators/rx.cc @@ -29,8 +29,14 @@ namespace operators { bool Rx::evaluate(Transaction *transaction, const std::string& input) { SMatch match; + if (m_param.empty()) { + return true; + } + if (regex_search(input, &match, *m_re) && match.size() >= 1) { - transaction->m_matched.push_back(match.match); + if (transaction) { + transaction->m_matched.push_back(match.match); + } return true; }