]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: fix progress for min_inspect_depth 4295/head
authorVictor Julien <victor@inliniac.net>
Fri, 11 Oct 2019 12:25:10 +0000 (14:25 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 11 Oct 2019 19:16:41 +0000 (21:16 +0200)
Make sure progress don't exceed raw_progress.

src/stream-tcp-reassemble.c

index d8e16b44162fecfa5032a152093991cad89eda14..b9966b5bd71ad3a654ac4db75e3a97ff18e2e6b3 100644 (file)
@@ -1550,9 +1550,11 @@ static int StreamReassembleRawDo(TcpSession *ssn, TcpStream *stream,
         } else {
             progress -= stream->min_inspect_depth;
         }
-        SCLogDebug("applied min inspect depth due to STREAMTCP_STREAM_FLAG_TRIGGER_RAW: progress %"PRIu64, progress);
 
         SCLogDebug("stream app %"PRIu64", raw %"PRIu64, STREAM_APP_PROGRESS(stream), STREAM_RAW_PROGRESS(stream));
+
+        progress = MIN(progress, STREAM_RAW_PROGRESS(stream));
+        SCLogDebug("applied min inspect depth due to STREAMTCP_STREAM_FLAG_TRIGGER_RAW: progress %"PRIu64, progress);
     }
 
     SCLogDebug("progress %"PRIu64", min inspect depth %u %s", progress, stream->min_inspect_depth, stream->flags & STREAMTCP_STREAM_FLAG_TRIGGER_RAW ? "STREAMTCP_STREAM_FLAG_TRIGGER_RAW":"(no trigger)");