1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Ensure that inheritable_socket() returned a valid FD before passing it to Setsockopt().

This commit is contained in:
henri
2012-07-12 17:17:46 +00:00
parent 51cf3b0df9
commit f66e0fcfb9

View File

@@ -382,6 +382,8 @@ int do_listen(int type, int proto, const union sockaddr_u *srcaddr_u)
ncat_exec_win.c, for --exec and --sh-exec. inheritable_socket is from
nbase. */
sock = inheritable_socket(srcaddr_u->storage.ss_family, type, proto);
if (sock < 0)
bye("socket: %s", socket_strerror(socket_errno()));
Setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &option_on, sizeof(int));