From ed3599b3d8d57dae3e1bab520a589bbb49bdc7db Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 25 May 2012 14:54:46 +0200 Subject: [PATCH] stream: improve error checking. --- src/stream-tcp-reassemble.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 */ -- 2.47.2