From b3bc68355d2ac274d868822f3acc498a64b74697 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 24 Aug 2026 10:39:53 +0000 Subject: [PATCH] affinity: handle NULL set name from --set affinity path Setting a cpu-affinity path with --set, like --set threading.cpu-affinity.worker-cpu-set.threads=28 creates an intermediate node under cpu-affinity whose val is NULL. With a legacy list format cpu-affinity, AffinitySetupLoadFromConfig() red the set name from the node val and passed it to GetAffinitySetName(), which then dereferenced the NULL pointer. Address it by simply checking for the NULL. Ticket: #6735. (cherry picked from commit 54504ed13cc6a44491b25f61378a9e53df56dbf5) --- src/util-affinity.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util-affinity.c b/src/util-affinity.c index 82bea23ded53..4538d63eaccc 100644 --- a/src/util-affinity.c +++ b/src/util-affinity.c @@ -291,6 +291,9 @@ static int BuildCpuset(const char *name, SCConfNode *node, cpu_set_t *cpu) */ static const char *GetAffinitySetName(const char *val) { + if (val == NULL) { + return NULL; + } if (strcmp(val, "decode-cpu-set") == 0 || strcmp(val, "stream-cpu-set") == 0 || strcmp(val, "reject-cpu-set") == 0 || strcmp(val, "output-cpu-set") == 0) { return NULL;