Menu

#57 Fix for -L ADDR:PORT optarg processing typo

open
nobody
5
2011-09-27
2011-09-27
Jim Klimov
No

The "-L" (tunneling) option is implemented with an error in current CVS version - the colon iz zeroed out in the string clone, but the original is tested as a hostname. Simple fix follows:

--- netcat-cvs-20110926-orig/src/netcat.c 2004-10-24 15:54:27.000000000 +0400
+++ netcat-cvs-20110926/src/netcat.c 2011-09-27 04:13:00.868888019 +0400
@@ -291,9 +291,9 @@
}

/* lookup the remote address and the remote port for tunneling */
- if (!netcat_resolvehost(&connect_sock.remote, optarg))
+ if (!netcat_resolvehost(&connect_sock.remote, pbuf))
ncprint(NCPRINT_ERROR | NCPRINT_EXIT,
- _("Couldn't resolve tunnel target host: %s"), optarg);
+ _("Couldn't resolve tunnel target host: %s"), pbuf);
if (!netcat_getport(&connect_sock.port, div, 0))
ncprint(NCPRINT_ERROR | NCPRINT_EXIT,
_("Invalid tunnel target port: %s"), div);

Discussion


Log in to post a comment.

MongoDB Logo MongoDB