]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: http-fetch: fix smp_fetch_hdr_ip()'s handling of brackets for IPv6
authorWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 12:56:22 +0000 (14:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 14:04:19 +0000 (16:04 +0200)
commit15c5226bd39d71eca73643e493c0505adf9e2253
tree9674f21b4a516f301c95db72a7f20b66dc370b59
parent009c32d863d74d10a209a43242e0279278a3957c
BUG/MINOR: http-fetch: fix smp_fetch_hdr_ip()'s handling of brackets for IPv6

IPv6 addresses can be read enclosed in brackets, but the length of the
string is not checked before checking them. If by lack of luck, the
buffer is empty but already contains '[' in the first place, we'd read
the byte at position -1, possibly crashing (even though in practice it
will not since allocated blocks will be precedeed by the malloc meta-
data). At least it could make asan/valgrind unhappy.

This can be backported to all versions.
src/http_fetch.c