]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3469: ftp_telnet: handle all space characters as a separator between...
authorShanmugam S (shanms) <shanms@cisco.com>
Fri, 10 Jun 2022 13:30:29 +0000 (13:30 +0000)
committerShanmugam S (shanms) <shanms@cisco.com>
Fri, 10 Jun 2022 13:30:29 +0000 (13:30 +0000)
Merge in SNORT/snort3 from ~ABHPAL/snort3:ftp_no_encrypt to master

Squashed commit of the following:

commit 4ef21c0f3c7b90b57c42d6075add9f80029e1ae4
Author: Abhijit Pal(abhpal) <abhpal@cisco.com>
Date:   Fri Jun 10 13:59:41 2022 +0530

    ftp_telnet: handle all space characters as a seperator between FTP request command and arguments

src/service_inspectors/ftp_telnet/pp_ftp.cc

index 7c5458232a560a2e94234b7f0e362eb55ea39bd3..78284a79a34d3e536a302357731b072d31b35f7e 100644 (file)
@@ -1334,7 +1334,6 @@ static int do_stateful_checks(FTP_SESSION* session, Packet* p,
  *
  */
 #define NUL 0x00
-#define FF 0x0c
 #define CR 0x0d
 #define LF 0x0a
 #define SP 0x20
@@ -1395,9 +1394,7 @@ int check_ftp(FTP_SESSION* ftpssn, Packet* p, int iMode)
         req->cmd_begin = (const char*)read_ptr;
 
         while ((read_ptr < end) &&
-            (*read_ptr != SP) &&
-            (*read_ptr != FF) &&
-            (*read_ptr != CR) &&
+            (!isspace(*read_ptr)) &&
             (*read_ptr != LF) &&    /* Check for LF when there wasn't a CR,
                                      * protocol violation, but accepted by
                                      * some servers. */
@@ -1636,7 +1633,7 @@ int check_ftp(FTP_SESSION* ftpssn, Packet* p, int iMode)
 
         if (read_ptr < end)
         {
-            if ((*read_ptr == SP) || (*read_ptr == FF))
+            if (isspace(*read_ptr))
             {
                 space = 1;
             }