]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: httpclient: limit transfers to the maximum available room
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Feb 2022 16:28:25 +0000 (17:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Feb 2022 16:32:12 +0000 (17:32 +0100)
commit11adb1d8fcab29ef8b12c93e3b036bb3dcf1607b
tree106a2c392cc047489b8c47e3576252be5b1cf883
parent8a91374487e13cf139ab36e483163a21ebdc6f4e
BUG/MEDIUM: httpclient: limit transfers to the maximum available room

A bug was uncovered by commit fc5912914 ("MINOR: httpclient: Don't limit
data transfer to 1024 bytes"), it happens that callers of b_xfer() and
b_force_xfer() are expected to check for available room in the target
buffer. Previously it was unlikely to be full but now with full buffer-
sized transfers, it happens more often and in practice it is possible
to crash the process with the debug command "httpclient" on the CLI by
going beyond a the max buffer size. Other call places ought to be
rechecked by now and it might be time to rethink this API if it tends
to generalize.

This must be backported to 2.5.
src/http_client.c