]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: improve error checking.
authorVictor Julien <victor@inliniac.net>
Fri, 25 May 2012 12:54:46 +0000 (14:54 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 25 May 2012 12:54:46 +0000 (14:54 +0200)
src/stream-tcp-reassemble.c

index 96c6f9a71104178943d31694720dbd21172e85e0..7624d35992aa08b017089fa7a58ef473fc910bbc 100644 (file)
@@ -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 */