mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
o [NSE] Made it a controlled Lua stack trace instead of a fatal error
when an NSE script sets a negative socket timeout. Vlatko Kosturjak reported the bug. [David]
This commit is contained in:
parent
06b988353a
commit
47030f71db
2 changed files with 6 additions and 0 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE] Made it a controlled Lua stack trace instead of a fatal error
|
||||
when an NSE script sets a negative socket timeout. Vlatko Kosturjak
|
||||
reported the bug. [David]
|
||||
|
||||
o [NSE] Fixed a bug which caused some NSE scripts to fail, due to the
|
||||
absence of the NSE SCRIPT_NAME environment variable when the scripts
|
||||
are loaded. Michael Pattrick reported the problem. [Djalal]
|
||||
|
|
|
|||
|
|
@ -756,6 +756,8 @@ static int l_set_timeout (lua_State *L)
|
|||
{
|
||||
nse_nsock_udata *nu = check_nsock_udata(L, 1, 0);
|
||||
nu->timeout = luaL_checkint(L, 2);
|
||||
if ((int) nu->timeout < -1)
|
||||
return luaL_error(L, "Negative timeout: %d", nu->timeout);
|
||||
return success(L);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue