]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tools: url2sa reads ipv4 too far
authorWilliam Lallemand <wlallemand@haproxy.org>
Fri, 18 Feb 2022 15:13:12 +0000 (16:13 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 18 Feb 2022 15:32:04 +0000 (16:32 +0100)
commit8a91374487e13cf139ab36e483163a21ebdc6f4e
tree530f89d2ba8a073f1676ed64d37767932643e9e9
parent2c8f984441e4b8875e2af306d00e1d00755f8ef7
BUG/MINOR: tools: url2sa reads ipv4 too far

The url2sa implementation is inconsitent when parsing an IPv4, indeed
url2sa() takes a <ulen> as a parameter where the call to url2ipv4() takes
a null terminated string. Which means url2ipv4 could try to read more
that it is supposed to.

This function is only used from a buffer so it never reach a unallocated
space. It can only cause an issue when used from the httpclient which
uses it with an ist.

This patch fixes the issue by copying everything in the trash and
null-terminated it.

Must be backported in all supported version.
src/tools.c