From b14a8518a37d8f7d93097a50882f7e09e1005aba Mon Sep 17 00:00:00 2001 From: patrik Date: Fri, 31 Aug 2012 14:59:25 +0000 Subject: [PATCH] replaced try/catch with silent failure --- scripts/lexmark-config.nse | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/lexmark-config.nse b/scripts/lexmark-config.nse index 73bb21d7b..230cb47cf 100644 --- a/scripts/lexmark-config.nse +++ b/scripts/lexmark-config.nse @@ -54,17 +54,16 @@ categories = {"discovery", "safe"} portrule = shortport.portnumber({5353,9100}, "udp") action = function( host, port ) - - - local catch = function() - stdnse.print_debug("lexmark-config failed to retrieve configuration") - end - - local try = nmap.new_try(catch) local result = {} - local response = try( dns.query( "", { port = port.number, host = host.ip, dtype="PTR", retPkt=true} ) ) - local txtrecords = try( dns.findNiceAnswer( dns.types.TXT, response, true ) ) + local status, response = dns.query( "", { port = port.number, host = host.ip, dtype="PTR", retPkt=true} ) + if ( not(status) ) then + return + end + local status, txtrecords = dns.findNiceAnswer( dns.types.TXT, response, true ) + if ( not(status) ) then + return + end for _, v in ipairs( txtrecords ) do if ( v:len() > 0 ) then