summaryrefslogtreecommitdiff
path: root/lib/socks.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-18 18:41:20 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-19 08:11:46 +0200
commit67521b5ecf0e3b0d8ea5278b02400811715069be (patch)
treeb8963f3895eb50192c272b3a4bc5a09fa8cddf08 /lib/socks.c
parentdbc5c1773845f9244d6c9a73f7a1069619322ddc (diff)
downloadcurl-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.c11
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) */