From: Victor Julien Date: Sat, 20 May 2023 19:43:57 +0000 (+0200) Subject: streaming: fix region buf_offset update X-Git-Tag: suricata-7.0.0-rc2~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b401fe525988c0260bd0b5f55304a7771807eb41;p=thirdparty%2Fsuricata.git streaming: fix region buf_offset update If region wasn't the first region, the buf_offset could get out of sync. Bug: #6041. --- diff --git a/src/util-streaming-buffer.c b/src/util-streaming-buffer.c index 2a7df7392e..90ef824666 100644 --- a/src/util-streaming-buffer.c +++ b/src/util-streaming-buffer.c @@ -499,9 +499,9 @@ static int SBBUpdate(StreamingBuffer *sb, const StreamingBufferConfig *cfg, #ifdef DEBUG SBBPrintList(sb); #endif - if (sbb->offset == sb->region.stream_offset) { - SCLogDebug("insert at head"); - sb->region.buf_offset = sbb->len; + if (sbb->offset == region->stream_offset) { + SCLogDebug("insert at region head"); + region->buf_offset = sbb->len; } return 0; }