mirror of
https://github.com/curl/curl.git
synced 2026-08-01 11:58:04 +03:00
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
This commit is contained in:
parent
cd68dfe831
commit
84ced9389e
5 changed files with 24 additions and 16 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue