BUG/MAJOR: tcp: only call registered actions when they're registered
Commit cc87a11 ("MEDIUM: tcp: add register keyword system.") introduced the registration of new keywords for TCP rulesets. Unfortunately it replaced the "accept" action with an unconditionnal call to the rule's action function, resulting in an immediate segfault when using the "accept" action in a TCP ruleset. This bug reported by Baptiste Assmann was introduced in 1.6-dev1, no backport is needed.
This commit is contained in:
parent
0b1a4541dc
commit
e91ffd093e
@ -1216,7 +1216,7 @@ resume_execution:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Custom keywords. */
|
/* Custom keywords. */
|
||||||
if (rule->action_ptr(rule, s->be, s) == 0) {
|
if (rule->action_ptr && !rule->action_ptr(rule, s->be, s)) {
|
||||||
s->current_rule = rule;
|
s->current_rule = rule;
|
||||||
goto missing_data;
|
goto missing_data;
|
||||||
}
|
}
|
||||||
@ -1336,7 +1336,7 @@ resume_execution:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Custom keywords. */
|
/* Custom keywords. */
|
||||||
if (!rule->action_ptr(rule, s->be, s)) {
|
if (rule->action_ptr && !rule->action_ptr(rule, s->be, s)) {
|
||||||
channel_dont_close(rep);
|
channel_dont_close(rep);
|
||||||
s->current_rule = rule;
|
s->current_rule = rule;
|
||||||
return 0;
|
return 0;
|
||||||
@ -1415,7 +1415,8 @@ int tcp_exec_req_rules(struct session *sess)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Custom keywords. */
|
/* Custom keywords. */
|
||||||
rule->action_ptr(rule, sess->fe, NULL);
|
if (rule->action_ptr)
|
||||||
|
rule->action_ptr(rule, sess->fe, NULL);
|
||||||
|
|
||||||
/* otherwise it's an accept */
|
/* otherwise it's an accept */
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user