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.
1 instance of this defect were found in the following locations:
Instance 1
File : lib/connect.c
Function: Curl_printable_address
|
Curl_printable_address(conn->tempaddr[i], ipaddress, MAX_IPADR_LEN); |
Code extract:
#ifndef CURL_DISABLE_VERBOSE_STRINGS
char ipaddress[MAX_IPADR_LEN];
char buffer[STRERROR_LEN];
Curl_printable_address(conn->tempaddr[i], ipaddress, MAX_IPADR_LEN); <------ HERE
#endif
infof(data, "connect to %s port %ld failed: %s\n",
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.
1 instance of this defect were found in the following locations:
Instance 1
File :
lib/connect.cFunction:
Curl_printable_addresscurl/lib/connect.c
Line 963 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: