diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-05-18 18:41:20 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-05-19 08:11:46 +0200 |
commit | 67521b5ecf0e3b0d8ea5278b02400811715069be (patch) | |
tree | b8963f3895eb50192c272b3a4bc5a09fa8cddf08 /lib/socks.c | |
parent | dbc5c1773845f9244d6c9a73f7a1069619322ddc (diff) | |
download | curl-67521b5ecf0e3b0d8ea5278b02400811715069be.tar.gz |
hostip: make Curl_printable_address not return anything
It was not used much anyway and instead we let it store a blank buffer
in case of failure.
Reported-by: MonocleAI
Fixes #5411
Closes #5418
Diffstat (limited to 'lib/socks.c')
-rw-r--r-- | lib/socks.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/socks.c b/lib/socks.c index 597757251..6031096f9 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -774,6 +774,7 @@ CURLcode Curl_SOCKS5(const char *proxy_user, CONNECT_RESOLVED: case CONNECT_RESOLVED: { struct Curl_addrinfo *hp = NULL; + size_t destlen; if(dns) hp = dns->addr; if(!hp) { @@ -782,13 +783,9 @@ CURLcode Curl_SOCKS5(const char *proxy_user, return CURLE_COULDNT_RESOLVE_HOST; } - if(Curl_printable_address(hp, dest, sizeof(dest))) { - size_t destlen = strlen(dest); - msnprintf(dest + destlen, sizeof(dest) - destlen, ":%d", remote_port); - } - else { - strcpy(dest, "unknown"); - } + Curl_printable_address(hp, dest, sizeof(dest)); + destlen = strlen(dest); + msnprintf(dest + destlen, sizeof(dest) - destlen, ":%d", remote_port); len = 0; socksreq[len++] = 5; /* version (SOCKS5) */ |