BUG/MINOR: quic: do not crash on CRYPTO ncbuf alloc failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 18 Apr 2025 16:02:48 +0000 (18:02 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 22 Apr 2025 08:34:24 +0000 (10:34 +0200)
commit1c913c47cad4b00c9fef726b32b1a4240161a89e
tree2262d6c9179147cbb7233be5f227b1066aa82f6d
parentc3f40894532072afb380f1779bce1ef85974df2f
BUG/MINOR: quic: do not crash on CRYPTO ncbuf alloc failure

To handle out-of-order received CRYPTO frames, a ncbuf instance is
allocated. This is done via the helper quic_get_ncbuf().

Buffer allocation was improperly checked. In case b_alloc() fails, it
crashes due to a BUG_ON(). Fix this by removing it. The function now
returns NULL on allocation failure, which is already properly handled in
its caller qc_handle_crypto_frm().

This should fix the last reported crash from github issue #2935.

This must be backported up to 2.6.

(cherry picked from commit 4309a6fbf80240b0880c5adf091f0075c3bcd53f)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
include/haproxy/quic_conn.h