Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Nmap Development: [PATCH] Test for getopt_long_only() return value -1

[PATCH] Test for getopt_long_only() return value -1

From: Kris Katterjohn <katterjohn_at_gmail.com>
Date: Sat, 16 Dec 2006 13:31:00 -0600

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

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]