]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: stream-int: properly check the memory allocation return
authorWilly Tarreau <w@1wt.eu>
Mon, 22 Dec 2014 18:34:00 +0000 (19:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Dec 2014 10:22:39 +0000 (11:22 +0100)
commita69fc9f803c05de93b03fc7d4a28d5c503c6d3c9
tree6be801bb3a9637f70e2881d27b3d1b4a6543916d
parentfe1ebcd2cf6cd928738055b4307b03196c412f70
BUG/MAJOR: stream-int: properly check the memory allocation return

In stream_int_register_handler(), we call si_alloc_appctx(si) but as a
mistake, instead of checking the return value for a NULL, we test <si>.
This bug was discovered under extreme memory contention (memory for only
two buffers with 500 connections waiting) and after 3 million failed
connections. While it was very hard to produce it, the fix is tagged
major because in theory it could happen when haproxy runs with a very
low "-m" setting preventing from allocating just the few bytes needed
for an appctx. But most users will never be able to trigger it. The
fix was confirmed to address the bug.

This fix must be backported to 1.5.
src/stream_interface.c