mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-10-31 17:18:47 +00:00
proxy_getaddrinfo: fix segfault when hints is NULL
This commit is contained in:
parent
40edf758ee
commit
037edbcb8e
@ -878,10 +878,16 @@ int proxy_getaddrinfo(const char *node, const char *service, const struct addrin
|
||||
(*res)->ai_canonname = space->addr_name;
|
||||
(*res)->ai_next = NULL;
|
||||
(*res)->ai_family = space->sockaddr_space.sa_family = AF_INET;
|
||||
(*res)->ai_addrlen = sizeof(space->sockaddr_space);
|
||||
|
||||
if(hints) {
|
||||
(*res)->ai_socktype = hints->ai_socktype;
|
||||
(*res)->ai_flags = hints->ai_flags;
|
||||
(*res)->ai_protocol = hints->ai_protocol;
|
||||
(*res)->ai_addrlen = sizeof(space->sockaddr_space);
|
||||
} else {
|
||||
(*res)->ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG);
|
||||
}
|
||||
|
||||
goto out;
|
||||
err2:
|
||||
free(space);
|
||||
|
Loading…
Reference in New Issue
Block a user