From b401fe525988c0260bd0b5f55304a7771807eb41 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 20 May 2023 21:43:57 +0200 Subject: [PATCH] streaming: fix region buf_offset update If region wasn't the first region, the buf_offset could get out of sync. Bug: #6041. --- src/util-streaming-buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }