From: Christopher Faulet Date: Wed, 7 Oct 2026 19:18:29 +0000 (+0200) Subject: BUG/MINOR: spoe: Fix the message list splice with an empty list X-Git-Tag: v3.5-dev9~102 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=34232a448c2759f0f1bc0b66967d2a2ff39c9e82;p=haproxy.git BUG/MINOR: spoe: Fix the message list splice with an empty list At the end of the parsing of a SPOE agent configuration file, the messages of the file are moved to the agent message list with a manual splice. However, this is only correct when the file defines at least one "spoe-message" section. With an empty list, the manual splice will corrupt the agent message list. Replace the manual splice with LIST_SPLICE(), which does nothing with an empty source list. This fixes the bug and this avoids to deal with list pointers manually. The regression was introduced by the commit 11610f3 ("MEDIUM: spoe: Parse new "spoe-group" section in SPOE config file"). The patch must be backported to all supported versions. --- diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 8a3c0c545..64a330089 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2583,9 +2583,7 @@ static int parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, finish: /* move curmsgs to the agent message list */ - curmsgs.n->p = &curagent->messages; - curmsgs.p->n = &curagent->messages; - curagent->messages = curmsgs; + LIST_SPLICE(&curagent->messages, &curmsgs); LIST_INIT(&curmsgs); conf->id = strdup(engine ? engine : curagent->id);