Nmap Development mailing list archives

[PATCH] Add return in some other files if fopen() fails


From: Kris Katterjohn <kjak () ispwest com>
Date: Mon, 21 Aug 2006 21:37:18 -0500

Okay, nmap_rpc.cc and protocols.cc have the same problem MACLookup.cc
had. This should be it.

As before, diffs against 4.20ALPHA4

Thanks,
Kris Katterjohn
--- x/nmap_rpc.cc       2006-03-05 18:00:03.000000000 -0600
+++ y/nmap_rpc.cc       2006-08-21 21:30:07.000000000 -0500
@@ -141,6 +141,7 @@ static void rpc_services_init() {
   fp = fopen(filename, "r");
   if (!fp) {
     fatal("Unable to open %s for reading rpc information", filename);
+    return;
   }
 
   while(fgets(line, sizeof(line), fp)) {

--- x/protocols.cc      2006-03-05 18:00:03.000000000 -0600
+++ y/protocols.cc      2006-08-21 21:29:42.000000000 -0500
@@ -128,6 +128,7 @@ static int nmap_protocols_init() {
   fp = fopen(filename, "r");
   if (!fp) {
     fatal("Unable to open %s for reading protocol information", filename);
+    return;
   }
 
   memset(protocol_table, 0, sizeof(protocol_table));

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: