]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http_fetch: make hdr_ip() resistant to empty fields
authorWilly Tarreau <w@1wt.eu>
Wed, 31 Mar 2021 09:41:36 +0000 (11:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 31 Mar 2021 09:45:42 +0000 (11:45 +0200)
commit645dc08533531416b91ca74ff5aa03154dc0ee50
tree0c211d6d202075708f7c88484b99cb3760d123cb
parent4bfc6630baaac8a23b0b7fb9b1d4b8e02e0e2a91
BUG/MINOR: http_fetch: make hdr_ip() resistant to empty fields

The fix in commit 7b0e00d94 ("BUG/MINOR: http_fetch: make hdr_ip() reject
trailing characters") made hdr_ip() more sensitive to empty fields, for
example if a trusted proxy incorrectly sends the header with an empty
value, we could return 0.0.0.0 which is not correct. Let's make sure we
only assign an IPv4 type here when a non-empty address was found.

This should be backported to all branches where the fix above was
backported.
src/http_fetch.c