Skip to content

Commit

Permalink
socket: fix addrinfo() with omitted service argument
Browse files Browse the repository at this point in the history
Actually pass NULL to getaddrinfo() when the service argument is omitted,
instead of incorrectly translating it to a string containing "null".

Signed-off-by: Jo-Philipp Wich <[email protected]>
  • Loading branch information
jow- committed May 8, 2024
1 parent b594ff8 commit 0d823e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ uc_socket_addrinfo(uc_vm_t *vm, size_t nargs)
return NULL;
}

servstr = (ucv_type(serv) != UC_STRING) ? ucv_to_string(vm, serv) : NULL;
servstr = (serv && ucv_type(serv) != UC_STRING) ? ucv_to_string(vm, serv) : NULL;
ret = getaddrinfo(ucv_string_get(host),
servstr ? servstr : ucv_string_get(serv),
ai_hints, &ai_res);
Expand Down

0 comments on commit 0d823e7

Please sign in to comment.