From a8f0daaf38c5ea18a768a6ee92cd8674f0902ef7 Mon Sep 17 00:00:00 2001 From: dmiller Date: Sun, 13 Dec 2015 21:39:48 +0000 Subject: [PATCH] Fix a crash in snmp-interfaces: http://seclists.org/nmap-dev/2015/q4/218 --- scripts/snmp-interfaces.nse | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/snmp-interfaces.nse b/scripts/snmp-interfaces.nse index 054a36476..38e66accb 100644 --- a/scripts/snmp-interfaces.nse +++ b/scripts/snmp-interfaces.nse @@ -301,7 +301,12 @@ function process_ips( if_tbl, ip_tbl ) for _, v in ipairs( ip_tbl ) do if ( v.oid:match("^" .. ip_index) ) then index = get_value_from_table( ip_tbl, v.oid ) + if not index then goto NEXT_PROCESS_IPS end item = if_tbl[index] + if not item then + stdnse.debug1("Unknown interface index %s", index) + goto NEXT_PROCESS_IPS + end local objid = v.oid:gsub( "^" .. ip_index, ip_addr ) local value = get_value_from_table( ip_tbl, objid ) @@ -316,6 +321,7 @@ function process_ips( if_tbl, ip_tbl ) if value then item.netmask = value end + ::NEXT_PROCESS_IPS:: end end