Fix RULE lookup in chained rules.

This commit is contained in:
Felipe Zimmerle
2018-10-15 16:42:36 -03:00
parent 120108fd33
commit 8bda7c0a45
4 changed files with 59 additions and 24 deletions

View File

@@ -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.";