From: Victor Julien Date: Sat, 14 Dec 2019 19:20:45 +0000 (+0100) Subject: streaming/api: fix overlap check X-Git-Tag: suricata-5.0.2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c050187a3ad78388e57781c4feb74426bc75e21;p=thirdparty%2Fsuricata.git streaming/api: fix overlap check In some cases a SBB could be seen as overlapping with the requested offset, when it was in fact precisely before it. In some special cases this could lead to the stream engine not progressing the 'raw' progress. --- diff --git a/src/util-streaming-buffer.c b/src/util-streaming-buffer.c index a3c04c4656..c2e8cde75e 100644 --- a/src/util-streaming-buffer.c +++ b/src/util-streaming-buffer.c @@ -70,7 +70,7 @@ static inline int InclusiveCompare(StreamingBufferBlock *lookup, StreamingBuffer const uint64_t tre = intree->offset + intree->len; if (lre <= intree->offset) // entirely before return -1; - else if (lre >= intree->offset && lre <= tre) // (some) overlap + else if (lre >= intree->offset && lookup->offset < tre && lre <= tre) // (some) overlap return 0; else return 1; // entirely after