mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 18:39:03 +00:00
Fail early when unable to properly resolve proxy names.
Some errors were not properly propagated. Ensure proxy_resolve() returns a negative error code and make the caller fatal() when unable to complete proxy_chain initialization for whatever reason.
This commit is contained in:
@@ -368,7 +368,7 @@ static struct proxy_node *proxy_node_new(char *proxystr) {
|
||||
break;
|
||||
|
||||
if (pspec->ops->node_new(&proxy, &uri) < 0)
|
||||
proxy = NULL;
|
||||
fatal("Cannot initialize proxy node %s", proxystr);
|
||||
|
||||
uri_free(&uri);
|
||||
|
||||
@@ -455,7 +455,7 @@ int proxy_resolve(const char *host, struct sockaddr *addr, size_t *addrlen) {
|
||||
|
||||
rc = getaddrinfo(host, NULL, NULL, &res);
|
||||
if (rc)
|
||||
return -rc;
|
||||
return -abs(rc);
|
||||
|
||||
*addr = *res->ai_addr;
|
||||
*addrlen = res->ai_addrlen;
|
||||
|
||||
Reference in New Issue
Block a user