From 84ced9389e1a7f576812e0675b37056331c4dbcd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 30 Aug 2019 11:29:55 +0200 Subject: 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 --- tests/unit/unit1607.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/unit/unit1607.c') diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index 458604229..a8b0331ce 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -150,7 +150,7 @@ UNITTEST_START if(tests[i].address[j] == &skip) continue; - if(addr && !Curl_addr2string(addr->ai_addr, + if(addr && !Curl_addr2string(addr->ai_addr, addr->ai_addrlen, ipaddress, &port)) { fprintf(stderr, "%s:%d tests[%d] failed. getaddressinfo failed.\n", __FILE__, __LINE__, i); -- cgit v1.2.3