From c0d92223dba9d0f213edd209efc7f5f02d6c1ac7 Mon Sep 17 00:00:00 2001 From: patrik Date: Tue, 31 Aug 2010 13:38:50 +0000 Subject: [PATCH] Added missing error handling for connection timeouts --- scripts/snmp-netstat.nse | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/snmp-netstat.nse b/scripts/snmp-netstat.nse index e5afbe4f6..158517635 100644 --- a/scripts/snmp-netstat.nse +++ b/scripts/snmp-netstat.nse @@ -87,7 +87,10 @@ action = function(host, port) try(socket:connect(host, port)) status, tcp = snmp.snmpWalk( socket, tcp_oid ) + if ( not(status) ) then return end + status, udp = snmp.snmpWalk( socket, udp_oid ) + if ( not(status) ) then return end socket:close() if ( tcp == nil ) or ( #tcp == 0 ) or ( udp==nil ) or ( #udp == 0 ) then