mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +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:
2
tcpip.cc
2
tcpip.cc
@@ -357,7 +357,7 @@ const char *inet_socktop(struct sockaddr_storage *ss) {
|
||||
/* Tries to resolve the given name (or literal IP) into a sockaddr structure.
|
||||
This function calls getaddrinfo and returns the same addrinfo linked list
|
||||
that getaddrinfo produces. Returns NULL for any error or failure to resolve.
|
||||
You need to call freeaddrinfo on the result. */
|
||||
You need to call freeaddrinfo on the result if non-NULL. */
|
||||
struct addrinfo *resolve_all(char *hostname, int pf)
|
||||
{
|
||||
struct addrinfo hints;
|
||||
|
||||
Reference in New Issue
Block a user