]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ftp: Generalize prelim positive reply
authorJeff Lucovsky <jeff@lucovsky.org>
Sat, 15 Jun 2019 14:03:23 +0000 (10:03 -0400)
committerVictor Julien <victor@inliniac.net>
Wed, 17 Jul 2019 06:21:54 +0000 (08:21 +0200)
Extend special case for reply code 150 to handle all preliminary
positive reply -- reply codes with `1xy`.

src/app-layer-ftp.c

index bc8323afd86abdc333d7336a834304283ff82496..05a2bd65d5c78e5af9729cf49dcaa5417d80a4f9 100644 (file)
@@ -824,7 +824,8 @@ static int FTPParseResponse(Flow *f, void *ftp_state, AppLayerParserState *pstat
         }
     }
 
-    if (input_len >= 4 && SCMemcmp("150 ", input, 4) == 0) {
+    /* Handle preliminary replies -- keep tx open */
+    if (FTPIsPPR(input, input_len)) {
         return retcode;
     }
 
@@ -833,6 +834,7 @@ tx_complete:
     return retcode;
 }
 
+
 #ifdef DEBUG
 static SCMutex ftp_state_mem_lock = SCMUTEX_INITIALIZER;
 static uint64_t ftp_state_memuse = 0;