Nmap Development mailing list archives

[PATCH] ipOps.lua ensure that a number is passed to stdnse.tohex()


From: jah <jah () zadkiel plus com>
Date: Tue, 07 Oct 2008 03:10:19 +0100

The attached fixes an error in ipOps.ip_to_bin() when a string is passed
to stdnse.tohex().  This should always be (and should always have been)
a number.

Regards,

jah
--- ipOps.lua.orig      2008-10-07 03:02:10.609375000 +0100
+++ ipOps.lua   2008-10-07 03:00:49.031250000 +0100
@@ -387,7 +387,7 @@
   if not ip:match( ":" ) then
     -- ipv4 string
     for octet in string.gfind( ip, "%d+" ) do
-      t[#t+1] = stdnse.tohex( octet )
+      t[#t+1] = stdnse.tohex( tonumber(octet) )
     end
     mask = "00"
   else

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

Current thread: