mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-24 12:20:59 +01:00
sc_need_room() function may be called with a negative value. In this case, the intent is to be notified if any space was made in the channel buffer. In the function, we get the min between the requested room and the maximum possible room in the buffer, considering it may be an HTX buffer. However this max value is unsigned and leads to an unsigned comparison, casting the negative value to an unsigned value. Of course, in this case, this always leads to the wrong result. This bug seems to have no effect but it is hard to be sure. To fix the issue, we take care to respect the requested room sign by casting the max value to a signed integer. This patch must be backported to 2.8.