]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-fcgi: Avoid value length overflow when it doesn't fit at once
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 15 Nov 2022 09:46:28 +0000 (10:46 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Nov 2022 08:27:09 +0000 (09:27 +0100)
commit52fd8a1b7b8a5a328cb5f4fabd42d2ca7af78760
tree2138c47e6d6d5290349562b9f844192720fddab2
parente8c7fb35882c453c7d1c2e923a3782a9348d8c5b
BUG/MEDIUM: mux-fcgi: Avoid value length overflow when it doesn't fit at once

When the request data are copied in a mbuf, if the free space is too small
to copy all data at once, the data length is shortened. When this is
performed, we reserve the size of the STDIN recod header and eventually the
same for the empty STDIN record if it is the last HTX block of the request.

However, there is no test to be sure the free space is large enough. Thus,
on this special case, when the mbuf is almost full, it is possible to
overflow the value length. Because of this bug, it is possible to experience
crashes from time to time.

This patch should fix the issue #1923. It must be backported as far as 2.4.
src/mux_fcgi.c