From: Eric Leblond Date: Tue, 2 Feb 2016 22:44:24 +0000 (+0100) Subject: stream: fix depth reached detection X-Git-Tag: suricata-3.2beta1~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2284%2Fhead;p=thirdparty%2Fsuricata.git stream: fix depth reached detection When a segment only partially fit in streaming depth, the stream depth reached flag was not set resulting in a continuous inspection of the rest of the session. By setting the stream depth reached flag when the segment partially fit we avoid to reenter the code and we don't take anymore a code path resulting in the flag not to be set. --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 30b725a18d..28bf4b537c 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -1805,6 +1805,7 @@ static uint32_t StreamTcpReassembleCheckDepth(TcpStream *stream, /* complete fit */ SCReturnUInt(size); } else { + stream->flags |= STREAMTCP_STREAM_FLAG_DEPTH_REACHED; /* partial fit, return only what fits */ uint32_t part = (stream->isn + stream_config.reassembly_depth) - seq; #if DEBUG