]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: chunk: fix chunk_appendf() to not write a zero if buffer is full
authorDragan Dosen <ddosen@haproxy.com>
Thu, 27 Jul 2023 18:30:42 +0000 (20:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 27 Jul 2023 20:05:25 +0000 (22:05 +0200)
commitf7596209eea21ee4e62ea24c8bc18e181d13f348
tree94b02575176b4baff67c4dac9d710f70d1f827e7
parentc156c5bda6d51c743b2f4af9ee87f53f38a946bd
BUG/MINOR: chunk: fix chunk_appendf() to not write a zero if buffer is full

If the buffer is completely full, the function chunk_appendf() would
write a zero past it, which can result in unexpected behavior.

Now we make a check before calling vsnprintf() and return the current
chunk size if no room is available.

This should be backported as far as 2.0.
src/chunk.c