]> git.ipfire.org Git - thirdparty/suricata.git/commit
util/streaming-buffer: add extra safety check
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 21 Nov 2024 14:20:44 +0000 (15:20 +0100)
committerVictor Julien <vjulien@oisf.net>
Thu, 12 Dec 2024 08:54:23 +0000 (09:54 +0100)
commit7d47fcf7f7fefacd2b0d8f482534a83b35a3c45e
tree295e90cd3efa2b0fa66f4d1b1a9120a112219601
parent949bfeca0e5f92212dc3d79f4a87c7c482d376aa
util/streaming-buffer: add extra safety check

Ticket: 7393

Check if GrowRegionToSize is called with an argument
trying to shrink the region size, and if so do nothing,
ie do not try to shrink, and just return ok.

This way, we avoid a buffer overflow from memeset using an
unsigned having underflowed.

(cherry picked from commit 9a53ec43b13f0039a083950511a18bf6f408e432)
src/util-streaming-buffer.c