From c3f88169a4ff21592e576d9c12c75809dd0b84e0 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 23 Aug 2012 18:45:42 +0000 Subject: [PATCH] Fix NSE error: attempt to get length of a number NSE: Script Engine Scan Aborted. An error was thrown by the engine: attempt to get length of a number value stack traceback: [C]: in function 'port_set_output' /home/rt/builds/nmap/nse_main.lua:314: in function 'set_output' /home/rt/builds/nmap/nse_main.lua:947: in function 'run' /home/rt/builds/nmap/nse_main.lua:1330: in function [C]: in ? This now allows return of anything stringifiable as second return value without crashing (though this may not be what the script author intends, better to not crash) --- nse_main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nse_main.lua b/nse_main.lua index fb695c241..f07e77d3e 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -297,7 +297,7 @@ do local tab, str if r2 then - tab, str = r1, r2; + tab, str = r1, tostring(r2); elseif type(r1) == "string" then tab, str = nil, r1; elseif r1 == nil then