summaryrefslogtreecommitdiff
path: root/lib/vquic/ngtcp2.c
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/vquic/ngtcp2.c
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/vquic/ngtcp2.c')
-rw-r--r--lib/vquic/ngtcp2.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c
index d98be181c..6b3d53ee0 100644
--- a/lib/vquic/ngtcp2.c
+++ b/lib/vquic/ngtcp2.c
@@ -541,12 +541,11 @@ CURLcode Curl_quic_connect(struct connectdata *conn,
uint8_t paramsbuf[64];
ngtcp2_transport_params params;
ssize_t nwrite;
- (void)addrlen;
qs->conn = conn;
/* extract the used address as a string */
- if(!Curl_addr2string((struct sockaddr*)addr, ipbuf, &port)) {
+ if(!Curl_addr2string((struct sockaddr*)addr, addrlen, ipbuf, &port)) {
char buffer[STRERROR_LEN];
failf(data, "ssrem inet_ntop() failed with errno %d: %s",
errno, Curl_strerror(errno, buffer, sizeof(buffer)));