From 8dae4f7c0bb8245de1676d121d0ce8f115ffa88a Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 17 Mar 2026 08:31:31 +0100 Subject: [PATCH] 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. --- src/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index 2382c4a36..cb26fb68c 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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"); } }