mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
BUG: too many variables in an assignment may cause a C stack overflow
This commit is contained in:
parent
3904a66ab0
commit
f6a81dbe97
2 changed files with 33 additions and 3 deletions
28
bugs
28
bugs
|
|
@ -1382,6 +1382,11 @@ patch = [[remove the '#include "lobject.h" and use
|
|||
'lua_pushfstring' instead of 'luaO_pushfstring']],
|
||||
}
|
||||
|
||||
|
||||
|
||||
-----------------------------------------------------------------
|
||||
-- Lua 5.1.2
|
||||
|
||||
Bug{
|
||||
what = [[Lua may close standard files,
|
||||
which then may be used by C]],
|
||||
|
|
@ -1492,6 +1497,29 @@ ltable.c:
|
|||
]],
|
||||
}
|
||||
|
||||
Bug{
|
||||
what = [[Too many variables in an assignment may cause a
|
||||
C stack overflow]],
|
||||
report = [[Mike Pall, on 07/2007]],
|
||||
since = [[5.0]],
|
||||
example = [[
|
||||
$ ulimit -s 1024 # Reduce C stack to 1MB for quicker results
|
||||
$ lua -e 'local s = "a,"; for i=1,18 do s = s..s end print(loadstring("local a "..s.."a=nil", ""))'
|
||||
]],
|
||||
patch = [[
|
||||
lparser.c:
|
||||
@@ -938,6 +938,8 @@
|
||||
primaryexp(ls, &nv.v);
|
||||
if (nv.v.k == VLOCAL)
|
||||
check_conflict(ls, lh, &nv.v);
|
||||
+ luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,
|
||||
+ "variable names");
|
||||
assignment(ls, &nv, nvars+1);
|
||||
}
|
||||
else { /* assignment -> `=' explist1 */
|
||||
]],
|
||||
}
|
||||
|
||||
Bug{
|
||||
what = [[ ]],
|
||||
report = [[ , on ]],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue