summaryrefslogtreecommitdiff
path: root/lib/connect.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-08-30 11:29:55 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-31 11:41:56 +0200
commit84ced9389e1a7f576812e0675b37056331c4dbcd (patch)
tree1a7b73484497f19b163c3fdba266ff7ab12193cc /lib/connect.h
parentcd68dfe8311c42f088ef082bfd90aeae65b9f589 (diff)
downloadcurl-84ced9389e1a7f576812e0675b37056331c4dbcd.tar.gz
Curl_addr2string: take an addrlen argument too
This allows the function to figure out if a unix domain socket has a file name or not associated with it! When a socket is created with socketpair(), as done in the fuzzer testing, the path struct member is uninitialized and must not be accessed. Bug: https://crbug.com/oss-fuzz/16699 Closes #4283
Diffstat (limited to 'lib/connect.h')
-rw-r--r--lib/connect.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/connect.h b/lib/connect.h
index e44c4a701..b23085a98 100644
--- a/lib/connect.h
+++ b/lib/connect.h
@@ -51,7 +51,8 @@ timediff_t Curl_timeleft(struct Curl_easy *data,
curl_socket_t Curl_getconnectinfo(struct Curl_easy *data,
struct connectdata **connp);
-bool Curl_addr2string(struct sockaddr *sa, char *addr, long *port);
+bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
+ char *addr, long *port);
/*
* Check if a connection seems to be alive.