Skip to content

Commit

Permalink
in notify.c use luaL_checkstack like we did in signal.c, because the …
Browse files Browse the repository at this point in the history
…caller could easily cause us to push more than LUA_MINSTACK values onto the stack
  • Loading branch information
William Ahern authored and William Ahern committed Aug 11, 2016
1 parent b563b87 commit 4abc3ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ static int ln_strflag(lua_State *L) {
flags &= ~flag;

if ((name = notify_strflag(flag))) {
luaL_checkstack(L, 1, "too many results");
lua_pushstring(L, name);
count++;
}
Expand Down
10 changes: 5 additions & 5 deletions src/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ static int lsl_strflag(lua_State *L) {
while ((flag = signal_flags(&flags))) {
const char *txt;

if (!(txt = signal_strflag(flag)))
continue;
luaL_checkstack(L, 1, "too many arguments");
lua_pushstring(L, txt);
count++;
if ((txt = signal_strflag(flag))) {
luaL_checkstack(L, 1, "too many results");
lua_pushstring(L, txt);
count++;
}
}
}

Expand Down

0 comments on commit 4abc3ac

Please sign in to comment.