]> git.ipfire.org Git - thirdparty/suricata.git/commit
util/streaming-buffer: fix regions intersection
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 21 Nov 2024 13:55:32 +0000 (14:55 +0100)
committerVictor Julien <vjulien@oisf.net>
Thu, 12 Dec 2024 08:54:23 +0000 (09:54 +0100)
commit0dc364aef2dec122fc0e7ee4c190864f4cc5f1bd
tree26c850dd8673e73a97d90e1dea166a914453d106
parenta578b0919fbb936d15c453a15e3d75f806ec2ea7
util/streaming-buffer: fix regions intersection

This was not a problem for current callers in Suricata,
as RegionsIntersect is only called through StreamingBufferInsertAt
which is only used by TCP...

And TCP uses default region gap = 256kb, and only calls
StreamingBufferInsertAt with a u16, so TCP never inserts a new
data that will strictly contain an existing region augmented
with region gap, which was the only case where RegionsIntersect
returned the wrong result, which could later lead to a
buffer overflow.

Ticket: 7393
(cherry picked from commit 282509f70c4ce805098e59535af445362e3e9ebd)
src/util-streaming-buffer.c