diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-09 15:57:45 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-09 15:57:45 -0200 |
commit | 7e425be975c7c5bedff234a0daeb803131ddfc60 (patch) | |
tree | 6ef635e5b02dddd4ef4b592deca668bc45779907 | |
parent | 0705e7b39f29ad140c2c0deb01ee5d4706f77636 (diff) | |
download | lua-7e425be975c7c5bedff234a0daeb803131ddfc60.tar.gz lua-7e425be975c7c5bedff234a0daeb803131ddfc60.tar.bz2 lua-7e425be975c7c5bedff234a0daeb803131ddfc60.zip |
bug (in 5.2): Chunk with too many lines can seg. fault
-rw-r--r-- | bugs | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -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.132 2014/05/07 16:57:27 roberto Exp roberto $ | 1883 | -** $Id: bugs,v 1.133 2014/09/01 16:56:01 roberto Exp roberto $ |
1884 | +** $Id: bugs,v 1.132 2014/05/07 16:57:27 roberto Exp roberto $ | 1884 | +** $Id: bugs,v 1.133 2014/09/01 16:56:01 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 | */ |
@@ -3248,6 +3248,30 @@ patch = [[ | |||
3248 | ]] | 3248 | ]] |
3249 | } | 3249 | } |
3250 | 3250 | ||
3251 | Bug{ | ||
3252 | what = [[Chunk with too many lines can seg. fault]], | ||
3253 | report = [[Roberto, 2014/11/14]], | ||
3254 | since = [[5.1 (at least)]], | ||
3255 | fix = nil, | ||
3256 | example = [[ | ||
3257 | -- the cause of the bug is the use of an unitialized variable, so | ||
3258 | -- it cannot be reproduced reliably | ||
3259 | local s = string.rep("\n", 2^24) | ||
3260 | print(load(function () return s end)) | ||
3261 | ]], | ||
3262 | patch = [[ | ||
3263 | --- llex.c 2013/08/30 15:49:41 2.63.1.2 | ||
3264 | +++ llex.c 2015/02/09 17:05:31 | ||
3265 | @@ -153,5 +153,5 @@ | ||
3266 | next(ls); /* skip `\n\r' or `\r\n' */ | ||
3267 | if (++ls->linenumber >= MAX_INT) | ||
3268 | - luaX_syntaxerror(ls, "chunk has too many lines"); | ||
3269 | + lexerror(ls, "chunk has too many lines", 0); | ||
3270 | } | ||
3271 | |||
3272 | ]] | ||
3273 | } | ||
3274 | |||
3251 | 3275 | ||
3252 | --[=[ | 3276 | --[=[ |
3253 | Bug{ | 3277 | Bug{ |