mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
Change l_exc_finalize to recognize both nil and false as exception indicators.
Previously only nil did this but most of NSE's internal functions return nil. A value of true means there was no exception and anything else is a fatal error.
This commit is contained in:
parent
672f9fc527
commit
53752ad8de
1 changed files with 4 additions and 2 deletions
|
|
@ -470,13 +470,15 @@ static int l_print_debug_unformatted(lua_State *l) {
|
|||
}
|
||||
|
||||
static int l_exc_finalize(lua_State *l) {
|
||||
if (lua_isnil(l, 1)) {
|
||||
if (!lua_toboolean(l, 1)) {
|
||||
/* false or nil. */
|
||||
lua_pushvalue(l, lua_upvalueindex(1));
|
||||
lua_call(l, 0, 0);
|
||||
lua_settop(l, 2);
|
||||
lua_error(l);
|
||||
return 0;
|
||||
} else if(lua_toboolean(l, 1)) {
|
||||
} else if(lua_isboolean(l, 1) && lua_toboolean(l, 1)) {
|
||||
/* true. */
|
||||
lua_remove(l, 1);
|
||||
return lua_gettop(l);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue