mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Fix RULE lookup in chained rules.
This commit is contained in:
@@ -78,9 +78,10 @@ int Driver::addSecRule(Rule *rule) {
|
||||
}
|
||||
|
||||
if (lastRule && lastRule->m_chained) {
|
||||
if (lastRule->m_chainedRule == NULL) {
|
||||
if (lastRule->m_chainedRuleChild == NULL) {
|
||||
rule->m_phase = lastRule->m_phase;
|
||||
lastRule->m_chainedRule = rule;
|
||||
lastRule->m_chainedRuleChild = rule;
|
||||
rule->m_chainedRuleParent = lastRule;
|
||||
if (rule->m_theDisruptiveAction) {
|
||||
m_parserError << "Disruptive actions can only be specified by";
|
||||
m_parserError << " chain starter rules.";
|
||||
@@ -88,12 +89,13 @@ int Driver::addSecRule(Rule *rule) {
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
Rule *a = lastRule->m_chainedRule;
|
||||
while (a->m_chained && a->m_chainedRule != NULL) {
|
||||
a = a->m_chainedRule;
|
||||
Rule *a = lastRule->m_chainedRuleChild;
|
||||
while (a->m_chained && a->m_chainedRuleChild != NULL) {
|
||||
a = a->m_chainedRuleChild;
|
||||
}
|
||||
if (a->m_chained && a->m_chainedRule == NULL) {
|
||||
a->m_chainedRule = rule;
|
||||
if (a->m_chained && a->m_chainedRuleChild == NULL) {
|
||||
a->m_chainedRuleChild = rule;
|
||||
rule->m_chainedRuleParent = a;
|
||||
if (a->m_theDisruptiveAction) {
|
||||
m_parserError << "Disruptive actions can only be ";
|
||||
m_parserError << "specified by chain starter rules.";
|
||||
|
Reference in New Issue
Block a user