Fix stack based memory disclosure in FTP client
Function ftp_pasvmode that parses FTP server response to PASV command goes outside data buffer - ptr is increased and checked only using !isdigit function.
@@ -143,7 +143,7 @@ static int ftp_pasvmode(struct ftpc_session_s *session, uint8_t addrport[6])
/* Skip over any leading stuff before address begins */
ptr = session->reply + 4;
- while (!isdigit((int)*ptr)) {
+ while (*ptr && !isdigit((int)*ptr)) {
ptr++;
}
