Skip to content

Commit 8dae4f7

Browse files
committed
BUG/MINOR: stream: Fix crash in stream dump if the current rule has no keyword
The commit 9f1e9ee ("DEBUG: stream: Display the currently running rule in stream dump") revealed a bug. When a stream is dumped, if it is blocked on a rule, we must take care the rule has a keyword to display its name. Indeed, some action parsings are inlined with the rule parser. In that case, there is no keyword attached to the rule. Because of this bug, crashes can be experienced when a stream is dumped. Now, when there is no keyword, "?" is display instead. This patch must be backported as far as 2.6.
1 parent ef2a292 commit 8dae4f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3841,7 +3841,7 @@ static void __strm_dump_to_buffer(struct buffer *buf, const struct show_sess_ctx
38413841
if (strm->current_rule_list && strm->current_rule) {
38423842
const struct act_rule *rule = strm->current_rule;
38433843
chunk_appendf(buf, "%s current_rule=\"%s\" [%s:%d] (%s)\n",
3844-
pfx, rule->kw->kw, rule->conf.file, rule->conf.line,
3844+
pfx, rule->kw ? rule->kw->kw : "?", rule->conf.file, rule->conf.line,
38453845
(rule == strm->waiting_entity.ptr) ? "YIELDING" : "RUNNING");
38463846
}
38473847
}

0 commit comments

Comments
 (0)