From: Daniel Stenberg Date: Thu, 17 Sep 2020 14:16:38 +0000 (+0200) Subject: ftp: avoid risk of reading uninitialized integers X-Git-Tag: curl-7_73_0~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d8731c8f52cf1ed40bbabd319a3b732cdbcd3d2;p=thirdparty%2Fcurl.git ftp: avoid risk of reading uninitialized integers If the received PASV response doesn't match the expected pattern, we could end up reading uninitialized integers for IP address and port number. Issue pointed out by muse.dev Closes #5972 --- diff --git a/lib/ftp.c b/lib/ftp.c index 868a97a532..4344013907 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1860,8 +1860,8 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, else if((ftpc->count1 == 1) && (ftpcode == 227)) { /* positive PASV response */ - unsigned int ip[4]; - unsigned int port[2]; + unsigned int ip[4] = {0, 0, 0, 0}; + unsigned int port[2] = {0, 0}; /* * Scan for a sequence of six comma-separated numbers and use them as