]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mworker: avoid passing NULL version in proc list serialization
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 13 Mar 2026 19:24:37 +0000 (20:24 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 13 Mar 2026 19:26:53 +0000 (20:26 +0100)
Add a NULL guard for the version field. This has no functional impact
since the master process never uses this field for its own mworker_proc
element, and should be the only one impacted. This avoid seeing "(null)"
in the version field when debugging.

Must be backported to 3.1 and later.

src/mworker.c

index 4d5e544bb41aa792cf9295761ea1598c43c9671d..9a02923264d6b6ec7689f728ab0f7befe368e93b 100644 (file)
@@ -125,7 +125,7 @@ void mworker_proc_list_to_env()
                        type = 'w';
 
                if (child->pid > -1)
-                       memprintf(&msg, "%s|type=%c;fd=%d;cfd=%d;pid=%d;reloads=%d;failedreloads=%d;timestamp=%d;id=%s;version=%s", msg ? msg : "", type, child->ipc_fd[0], child->ipc_fd[1], child->pid, child->reloads, child->failedreloads, child->timestamp, child->id ? child->id : "", child->version);
+                       memprintf(&msg, "%s|type=%c;fd=%d;cfd=%d;pid=%d;reloads=%d;failedreloads=%d;timestamp=%d;id=%s;version=%s", msg ? msg : "", type, child->ipc_fd[0], child->ipc_fd[1], child->pid, child->reloads, child->failedreloads, child->timestamp, child->id ? child->id : "", child->version ? child->version : "");
        }
        if (msg)
                setenv("HAPROXY_PROCESSES", msg, 1);