]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: debug: fix "debug dev fd" crash on unknown address families
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 30 Oct 2026 09:53:08 +0000 (10:53 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 30 Oct 2026 13:04:04 +0000 (14:04 +0100)
commit21a17a5c4ab354e16592e42860238d36decd8648
treed6a7d6185a01051b49ebb770e2ff1f9cf2622680
parenta9e333140c7bc2f9b73924a7c28d16513921bbcd
BUG/MINOR: debug: fix "debug dev fd" crash on unknown address families

"debug dev fd" formats the local and peer addresses of each fd with
sa2str() and then replaces non-printable characters in the result. It
returns NULL for address families other than AF_INET, AF_INET6, AF_UNIX
and some AF_CUST_*. For supported address families, it can also return
NULL in case of a memory allocation failure.

Only an admin in expert mode can run the command.

Let's skip the cleanup and print "?" when sa2str() fails.

This fixes GitHub issue #3546.

This must be backported to all stable versions. In fact, strlen()
without guard was introduced in 3.1, which guarantees a crash in case of
an unsupported address. For older releases, only an unsafe
chunk_appendf() is present which may cause issues.
src/debug.c