]> granicus.if.org Git - curl/commitdiff
ftp: avoid two unsigned int overflows in FTP listing parser
authorTim Rühsen <tim.ruehsen@gmx.de>
Sat, 3 Nov 2018 17:49:00 +0000 (18:49 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 9 Nov 2018 22:08:46 +0000 (23:08 +0100)
Curl_ftp_parselist: avoid unsigned integer overflows

The overflow has no real world impact, just avoid it for "best
practice".

Closes #3225

lib/ftplistparser.c

index 249fe09c84390d4be26bc3ad295fdc0838146ee0..1b1de5c3cd76e66bfbd6f9bbc6668839f9146888 100644 (file)
@@ -405,7 +405,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
             parser->state.UNIX.main = PL_UNIX_FILETYPE;
             /* start FSM again not considering size of directory */
             finfo->b_used = 0;
-            i--;
+            continue;
           }
           break;
         case PL_UNIX_TOTALSIZE_READING: