mirror of
https://github.com/nmap/nmap.git
synced 2026-10-25 05:13:04 +00:00
Check that the argument to freeaddrinfo is not NULL. The behavior may be
unspecified and causes a segmentation fault on Android Bionic libc. Vlatko fixed the bug in his Android binaries and it was first reported by @alexismm2.
This commit is contained in:
parent
f8b55e3253
commit
bf99fb231b
5 changed files with 13 additions and 5 deletions
|
|
@ -220,7 +220,8 @@ int TargetGroup::parse_expr(const char * const target_expr, int af) {
|
|||
resolvedaddrs.push_back(ss);
|
||||
}
|
||||
}
|
||||
freeaddrinfo(addrs);
|
||||
if (addrs != NULL)
|
||||
freeaddrinfo(addrs);
|
||||
|
||||
if (resolvedaddrs.empty()) {
|
||||
error("Failed to resolve given hostname/IP: %s. Note that you can't use '/mask' AND '1-4,7,100-' style IP ranges", target_net);
|
||||
|
|
@ -330,7 +331,8 @@ int TargetGroup::parse_expr(const char * const target_expr, int af) {
|
|||
resolvedaddrs.push_back(ss);
|
||||
}
|
||||
}
|
||||
freeaddrinfo(addrs);
|
||||
if (addrs != NULL)
|
||||
freeaddrinfo(addrs);
|
||||
|
||||
if (resolvedaddrs.empty()) {
|
||||
error("Failed to resolve given IPv6 hostname/IP: %s. Note that you can't use '/mask' or '[1-4,7,100-]' style ranges for IPv6.", hostexp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue