Skip to content

Commit

Permalink
Allow connections to port 0. Fixes #1560
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Apr 18, 2019
1 parent 85ec647 commit 3de7a01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG
@@ -1,5 +1,8 @@
#Nmap Changelog ($Id$); -*-text-*-

o [Ncat][GH#1560] Allow Ncat to connect to servers on port 0, provided that the
socket implementation allows this. [Daniel Miller]

o Update the included libpcap to 1.9.0. [Daniel Miller]

o [NSE][GH#1544] Fix a logic error that resulted in scripts not honoring the
Expand Down
2 changes: 1 addition & 1 deletion ncat/ncat_main.c
Expand Up @@ -891,7 +891,7 @@ int main(int argc, char *argv[])

errno = 0;
long_port = strtol(argv[optind], NULL, 10);
if (errno != 0 || long_port <= 0 || long_port > 65535)
if (errno != 0 || long_port < 0 || long_port > 65535)
bye("Invalid port number \"%s\".", argv[optind]);

o.portno = (unsigned short) long_port;
Expand Down

0 comments on commit 3de7a01

Please sign in to comment.