]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
streaming: fix region buf_offset update
authorVictor Julien <vjulien@oisf.net>
Sat, 20 May 2023 19:43:57 +0000 (21:43 +0200)
committerVictor Julien <vjulien@oisf.net>
Sun, 21 May 2023 04:46:04 +0000 (06:46 +0200)
If region wasn't the first region, the buf_offset could get out of
sync.

Bug: #6041.

src/util-streaming-buffer.c

index 2a7df7392e7e77faa97f991111dc33e3485b83e8..90ef8246666a02b32e9c4a5528f8df3efc7ec9a8 100644 (file)
@@ -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;
 }