What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
3 instances of this defect were found in the following locations:
Instance 1
File : lib/ftp.c
Function: Curl_GetFTPResponse
|
Curl_GetFTPResponse(&nread, conn, &ftpcode); |
Code extract:
}
else if(result & CURL_CSELECT_IN) {
infof(data, "Ctrl conn has data while waiting for data conn\n");
Curl_GetFTPResponse(&nread, conn, &ftpcode); <------ HERE
if(ftpcode/100 > 3)
How can I fix it?
Correct reference usage found in lib/ftp.c at line 3380.
|
result = Curl_GetFTPResponse(&nread, conn, &ftpcode); |
Code extract:
pp->response = Curl_now(); /* timeout relative now */
result = Curl_GetFTPResponse(&nread, conn, &ftpcode); <------ HERE
if(result)
return result;
Instance 2
File : lib/ftp.c
Function: Curl_inet_ntop
|
Curl_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf)); |
Code extract:
break;
#endif
default:
Curl_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf)); <------ HERE
break;
}
How can I fix it?
Correct reference usage found in lib/connect.c at line 650.
|
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr, |
Code extract:
#ifdef ENABLE_IPV6
case AF_INET6:
si6 = (struct sockaddr_in6 *)(void *) sa;
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr, <------ HERE
addr, MAX_IPADR_LEN)) {
unsigned short us_port = ntohs(si6->sin6_port);
Instance 3
File : lib/ftp.c
Function: Curl_printable_address
|
Curl_printable_address(ai, buf, sizeof(buf)); |
Code extract:
int port)
{
char buf[256];
Curl_printable_address(ai, buf, sizeof(buf)); <------ HERE
infof(conn->data, "Connecting to %s (%s) port %d\n", newhost, buf, port);
}
How can I fix it?
Correct reference usage found in lib/socks.c at line 785.
|
if(Curl_printable_address(hp, dest, sizeof(dest))) { |
Code extract:
return CURLE_COULDNT_RESOLVE_HOST;
}
if(Curl_printable_address(hp, dest, sizeof(dest))) { <------ HERE
size_t destlen = strlen(dest);
msnprintf(dest + destlen, sizeof(dest) - destlen, ":%d", remote_port);
What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.
3 instances of this defect were found in the following locations:
Instance 1
File :
lib/ftp.cFunction:
Curl_GetFTPResponsecurl/lib/ftp.c
Line 412 in 17b1405
Code extract:
} else if(result & CURL_CSELECT_IN) { infof(data, "Ctrl conn has data while waiting for data conn\n"); Curl_GetFTPResponse(&nread, conn, &ftpcode); <------ HERE if(ftpcode/100 > 3)How can I fix it?
Correct reference usage found in
lib/ftp.cat line3380.curl/lib/ftp.c
Line 3380 in 17b1405
Code extract:
Instance 2
File :
lib/ftp.cFunction:
Curl_inet_ntopcurl/lib/ftp.c
Line 1060 in 17b1405
Code extract:
How can I fix it?
Correct reference usage found in
lib/connect.cat line650.curl/lib/connect.c
Line 650 in 17b1405
Code extract:
Instance 3
File :
lib/ftp.cFunction:
Curl_printable_addresscurl/lib/ftp.c
Line 3453 in 17b1405
Code extract:
How can I fix it?
Correct reference usage found in
lib/socks.cat line785.curl/lib/socks.c
Line 785 in 17b1405
Code extract: