From: Victor Julien Date: Fri, 11 Oct 2019 12:25:10 +0000 (+0200) Subject: stream: fix progress for min_inspect_depth X-Git-Tag: suricata-5.0.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d19ded6c43c78fb01aca6a93beaaeeeac53a73d6;p=thirdparty%2Fsuricata.git stream: fix progress for min_inspect_depth Make sure progress don't exceed raw_progress. --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index d8e16b4416..b9966b5bd7 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -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)");