Skip to content

Commit

Permalink
Fixed stack corruption when using string.format("%q")
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 committed Jul 9, 2023
1 parent 445025c commit 834160d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lstrlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,10 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
case LUA_TNUMBER:
s = luaL_tolstring(L, arg, &l); /* pushes the string version to the top of the stack */
luaL_addlstring(b, s, l);
lua_pop(L, 1);
break;
case LUA_TSTRING: {
s = luaL_tolstring(L, arg, &l);
s = lua_tolstring(L, arg, &l);
luaL_addchar(b, '"');
while (l--) {
switch (*s) {
Expand Down

0 comments on commit 834160d

Please sign in to comment.