mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
Don't crash when an NSE library (e.g. sasl) calls stdnse.debug during require
This commit is contained in:
parent
2f02fa2935
commit
d1e429f42b
1 changed files with 6 additions and 0 deletions
|
|
@ -68,6 +68,12 @@ _ENV = require "strict" {};
|
|||
-- @usage stdnse.sleep(1.5)
|
||||
_ENV.sleep = nmap.socket.sleep;
|
||||
|
||||
-- These stub functions get overwritten by the script run loop in nse_main.lua
|
||||
-- These empty stubs will be used if a library calls stdnse.debug while loading
|
||||
_ENV.getid = function () return end
|
||||
_ENV.getinfo = function () return end
|
||||
_ENV.gethostport = function () return end
|
||||
|
||||
local function debug (level, ...)
|
||||
if type(level) ~= "number" then
|
||||
return debug(1, level, ...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue