Nmap Development mailing list archives

Re: [nmap-svn] r27941 - nmap/scripts


From: Patrik Karlsson <patrik () cqure net>
Date: Sun, 29 Jan 2012 06:52:38 +0100

On Sun, Jan 29, 2012 at 1:17 AM, David Fifield <david () bamsoftware com>wrote:

On Sat, Jan 28, 2012 at 02:03:11PM -0800, commit-mailer@insecure.orgwrote:
Modified: nmap/scripts/ip-geolocation-geoplugin.nse

==============================================================================
--- nmap/scripts/ip-geolocation-geoplugin.nse (original)
+++ nmap/scripts/ip-geolocation-geoplugin.nse Sat Jan 28 14:03:11 2012
@@ -41,7 +41,10 @@

      local output = {}
      table.insert(output, "coordinates (lat,lon):
"..loc.geoplugin_latitude..","..loc.geoplugin_longitude)
-     table.insert(output,"state: ".. loc.geoplugin_regionName..", "..
loc.geoplugin_countryName)
+     -- The JSON response for regionName contains a null sometimes
which is represented
+     -- as a table by the library.
+     local regionName = ("table" == type(loc.geoplugin_regionName)) and
"Unknown" or loc.geoplugin_regionName
+     table.insert(output,"state: ".. regionName ..", "..
loc.geoplugin_countryName)

Would this be better
       local regionName = (loc.geoplugin_regionName == json.NULL) and
"Unknown" or loc.geoplugin_regionName

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


Yes it would. Just committed it.

Thanks,
Patrik
-- 
Patrik Karlsson
http://www.cqure.net
http://twitter.com/nevdull77
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: