]> granicus.if.org Git - php/commitdiff
MFB
authorAntony Dovgal <tony2001@php.net>
Mon, 26 Mar 2007 08:02:36 +0000 (08:02 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 26 Mar 2007 08:02:36 +0000 (08:02 +0000)
ext/ftp/ftp.c

index b2166f1becb3c4c574388cff4b91495d2e0c9641..80165e85088078b56245f5b19a3ef88faf00eb13 100644 (file)
@@ -1096,12 +1096,18 @@ ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args)
        int             size;
        char            *data;
 
+       if (strpbrk(cmd, "\r\n")) {
+               return 0;
+       }
        /* build the output buffer */
        if (args && args[0]) {
                /* "cmd args\r\n\0" */
                if (strlen(cmd) + strlen(args) + 4 > FTP_BUFSIZE) {
                        return 0;
                }
+               if (strpbrk(args, "\r\n")) {
+                       return 0;
+               }
                size = snprintf(ftp->outbuf, sizeof(ftp->outbuf), "%s %s\r\n", cmd, args);
        } else {
                /* "cmd\r\n\0" */