|
[PATCH] Test for getopt_long_only() return value -1: msg#00075security.nmap.devel
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 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [PATCH] Dramatically reduce # of fopen()s and fclose()s in nbase_rnd.c: 00075, Kris Katterjohn |
|---|---|
| Next by Date: | Re: nmap doesn't compile on Solaris 9 with Sun Studio Pro: 00075, Leo Zhadanovsky |
| Previous by Thread: | [PATCH] Dramatically reduce # of fopen()s and fclose()s in nbase_rnd.ci: 00075, Kris Katterjohn |
| Next by Thread: | [PATCH] Change C++ comments to C comments in nmapfe and nsock: 00075, Kris Katterjohn |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |