On Sun, Jun 14, 2026 at 11:24:55AM +0200, Ilia Shipitsin wrote:
> Add an early guard in ncbmb_make() to handle allocation failure paths
> cleanly when area is NULL.
> Returning NCBMBUF_NULL avoids dereferencing a null pointer in the
> subsequent buffer/bitmap setup and memset, and fixes the related static
> analysis warning (nullPointerOutOfMemory).
> found by cppcheck:
> cppcheck --enable=all -j$(nproc) -I include -I /usr/include 
> --output-file=haproxy.log .

Hi,

Is this patch really needed ? The only place where ncbmb_make() is
called right now is in quic_get_ncbuf(), and an allocation failure on
area would be spotted before the call to ncbmb_make(). Besides, the
equivalent ncb_make() is similar in that it does not check for area,
which should be implicitely valid, and I do want to have a similar API
as much as possible between these two similar non-contiguous buffer
implementations.

Thanks,

-- 
Amaury Denoyelle


Reply via email to