The attached patch checks for a return value of -1 instead of EOF from
getopt_long_only() in nmap.cc. While EOF is typically -1, it's not
guaranteed (and a quick glance at nbase/getopt.c shows it returns "-1").
It's a diff against 4.21ALPHA1
Thanks,
Kris Katterjohn
--- x/nmap.cc 2006-12-10 18:34:36.000000000 -0600
+++ y/nmap.cc 2006-12-16 13:24:32.000000000 -0600
@@ -613,7 +613,7 @@ int nmap_main(int argc, char *argv[]) {
/* OK, lets parse these args! */
optind = 1; /* so it can be called multiple times */
- while((arg = getopt_long_only(argc,fakeargv,"6Ab:D:d::e:Ffg:hIi:M:m:nO::o:P:p:qRrS:s:T:Vv", long_options, &option_index)) != EOF) {
+ while((arg = getopt_long_only(argc,fakeargv,"6Ab:D:d::e:Ffg:hIi:M:m:nO::o:P:p:qRrS:s:T:Vv", long_options, &option_index)) != -1) {
switch(arg) {
case 0:
#ifndef NOLUA
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Dec 16 2006