From: Victor Julien Date: Fri, 25 May 2012 12:54:46 +0000 (+0200) Subject: stream: improve error checking. X-Git-Tag: suricata-1.3beta2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed3599b3d8d57dae3e1bab520a589bbb49bdc7db;p=thirdparty%2Fsuricata.git stream: improve error checking. --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 96c6f9a711..7624d35992 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -2480,8 +2480,7 @@ static inline int StreamTcpReturnSegmentCheck(TcpSession *ssn, TcpStream *stream * \param flags direction flags */ void StreamTcpPruneSession(Flow *f, uint8_t flags) { - if (f == NULL || f->protoctx == NULL || - ((flags & (STREAM_TOSERVER|STREAM_TOCLIENT)) == 0)) + if (f == NULL || f->protoctx == NULL) return; TcpSession *ssn = f->protoctx; @@ -2491,6 +2490,8 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags) { stream = &ssn->client; } else if (flags & STREAM_TOCLIENT) { stream = &ssn->server; + } else { + return; } /* loop through the segments and fill one or more msgs */