mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-02 04:27:47 +03:00
Removes a regex optimization added at #1536
This commit is contained in:
@@ -33,17 +33,14 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule,
|
||||
const std::string& input, std::shared_ptr<RuleMessage> ruleMessage) {
|
||||
SMatch match;
|
||||
std::list<SMatch> matches;
|
||||
Regex * re = m_re;
|
||||
Regex *re;
|
||||
|
||||
if (m_param.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string eparam = MacroExpansion::expand(m_param, transaction);
|
||||
|
||||
if (eparam != m_param) {
|
||||
re = new Regex(eparam);
|
||||
}
|
||||
re = new Regex(eparam);
|
||||
|
||||
matches = re->searchAll(input);
|
||||
if (rule && rule->getActionsByName("capture").size() > 0 && transaction) {
|
||||
@@ -65,9 +62,7 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule,
|
||||
logOffset(ruleMessage, i.m_offset, i.m_length);
|
||||
}
|
||||
|
||||
if (re != m_re) {
|
||||
delete re;
|
||||
}
|
||||
delete re;
|
||||
|
||||
if (matches.size() > 0) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user