aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-07-02 16:57:34 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-07-02 16:57:34 -0300
commit0c258c84927ffe8540fc9590bdce802d598faa6a (patch)
treeb04ec15640f57acbf48e9284af608e20e883c45f
parentd57c9cdefc6f00d8bf8bb24b96e65631a1c3ef18 (diff)
downloadlua-0c258c84927ffe8540fc9590bdce802d598faa6a.tar.gz
lua-0c258c84927ffe8540fc9590bdce802d598faa6a.tar.bz2
lua-0c258c84927ffe8540fc9590bdce802d598faa6a.zip
smart use of varargs may create functions that return too
many arguments and overflow the stack of C functions.
-rw-r--r--bugs24
1 files changed, 22 insertions, 2 deletions
diff --git a/bugs b/bugs
index 3b45c0c2..de8001cf 100644
--- a/bugs
+++ b/bugs
@@ -1880,8 +1880,8 @@ patch = [[
1880+++ lundump.c 2008/04/04 19:51:41 2.7.1.4 1880+++ lundump.c 2008/04/04 19:51:41 2.7.1.4
1881@@ -1,5 +1,5 @@ 1881@@ -1,5 +1,5 @@
1882 /* 1882 /*
1883-** $Id: bugs,v 1.100 2009/06/15 14:12:59 roberto Exp roberto $ 1883-** $Id: bugs,v 1.101 2009/07/01 21:10:33 roberto Exp roberto $
1884+** $Id: bugs,v 1.100 2009/06/15 14:12:59 roberto Exp roberto $ 1884+** $Id: bugs,v 1.101 2009/07/01 21:10:33 roberto Exp roberto $
1885 ** load precompiled Lua chunks 1885 ** load precompiled Lua chunks
1886 ** See Copyright Notice in lua.h 1886 ** See Copyright Notice in lua.h
1887 */ 1887 */
@@ -2193,3 +2193,23 @@ patch = [[
2193]], 2193]],
2194} 2194}
2195 2195
2196But{
2197what = [[smart use of varargs may create functions that return too
2198many arguments and overflow the stack of C functions]],
2199report = [[Patrick Donnelly, on 2008/12/10]],
2200since = [[]],
2201example = [[
2202local function lunpack(i, ...)
2203 if i == 0 then return ...
2204 else
2205 return lunpack(i-1, 1, ...)
2206 end
2207end
2208
2209Now, if C calls lunpack(n) with a huge n, it may end with
2210too many values in its stack and confuse its stack indices.
2211]],
2212patch = [[
2213]],
2214}
2215}