BUG/MINOR: stream: Fix crash in stream dump if the current rule has no keyword

The commit 9f1e9ee0e ("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.
This commit is contained in:
Christopher Faulet 2026-03-17 08:31:31 +01:00
parent ef2a292585
commit 8dae4f7c0b

View File

@ -3841,7 +3841,7 @@ static void __strm_dump_to_buffer(struct buffer *buf, const struct show_sess_ctx
if (strm->current_rule_list && strm->current_rule) {
const struct act_rule *rule = strm->current_rule;
chunk_appendf(buf, "%s current_rule=\"%s\" [%s:%d] (%s)\n",
pfx, rule->kw->kw, rule->conf.file, rule->conf.line,
pfx, rule->kw ? rule->kw->kw : "?", rule->conf.file, rule->conf.line,
(rule == strm->waiting_entity.ptr) ? "YIELDING" : "RUNNING");
}
}