diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-08-30 11:29:55 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-08-31 11:41:56 +0200 |
commit | 84ced9389e1a7f576812e0675b37056331c4dbcd (patch) | |
tree | 1a7b73484497f19b163c3fdba266ff7ab12193cc /tests/unit | |
parent | cd68dfe8311c42f088ef082bfd90aeae65b9f589 (diff) | |
download | curl-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 'tests/unit')
-rw-r--r-- | tests/unit/unit1607.c | 2 | ||||
-rw-r--r-- | tests/unit/unit1609.c | 2 |
2 files changed, 2 insertions, 2 deletions
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); diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index d919c9ea9..8223a147c 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -150,7 +150,7 @@ UNITTEST_START if(!addr && !tests[i].address[j]) break; - 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. Curl_addr2string failed.\n", __FILE__, __LINE__, i); |