]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: httpclient/cli: fix NULL dereference when the response has no header
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 19 Nov 2026 15:44:02 +0000 (16:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Nov 2026 11:36:57 +0000 (12:36 +0100)
commitbd2c92daba75b31b72375b1636c29bfc904275ec
tree0dcf2475618648ceebd792a5da52fd79c65199f0
parent5118dd42805d7fd847afb083e60c985156426be0
BUG/MINOR: httpclient/cli: fix NULL dereference when the response has no header

The CLI "httpclient" command (expert mode) displays the response status
line, then its headers, then its body. The httpclient applet only
allocates the response headers array when the response contains at least
one header.

A response without any header is perfectly legal for HTTP/1.0, so any
server which answers a header-less response crashes the process when the
"httpclient" command is used against it. Only an admin can run this
command, so it cannot be triggered by untrusted input and stays MEDIUM,
but a crash remains a crash for users who rely on this command to probe
their backends.

This patch must be backported to 3.3.
reg-tests/cli/httpclient_no_headers.vtc [new file with mode: 0644]
src/httpclient_cli.c