From 22a77a865cc782c4e9865a5c636131de7f6eff66 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 29 Apr 2009 23:33:44 +0000 Subject: [PATCH] Use host.ip, not just (undefined) ip in whois.nse exception error messages. Instead of handling an error nicely, it caused a format string error of its own: ./nselib/stdnse.lua:61: bad argument #3 to 'format' (string expected, got nil) It seems that a deadlock happens immediately after one of these errors occurs. This change doesn't fix the deadlock but allows the underlying error message to be printed. --- scripts/whois.nse | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/whois.nse b/scripts/whois.nse index 7222db30a..95db5360f 100644 --- a/scripts/whois.nse +++ b/scripts/whois.nse @@ -191,7 +191,7 @@ action = function( host ) status, retval = pcall( get_next_action, tracking, host.ip ) if not status then - stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, ip, retval ) + stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, host.ip, retval ) else tracking = retval end if tracking.this_db then @@ -202,13 +202,13 @@ action = function( host ) -- analyse data status, retval = pcall( analyse_response, tracking, host.ip, response, data ) if not status then - stdnse.print_debug( "%s %s pcall caught an exception in analyse_response: %s.", filename, ip, retval ) + stdnse.print_debug( "%s %s pcall caught an exception in analyse_response: %s.", filename, host.ip, retval ) else data = retval end -- get next action status, retval = pcall( get_next_action, tracking, host.ip ) if not status then - stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, ip, retval ) + stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, host.ip, retval ) if not tracking.last_db then tracking.last_db, tracking.this_db = tracking.this_db or tracking.next_db, nil end else tracking = retval end end