diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-23 16:20:43 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-23 16:20:43 -0300 |
commit | 27c5b1b2370e730f2ccd1dcae88e3601035e40c4 (patch) | |
tree | b35965cec7575a9bfd722474bc34f07c90ed6491 | |
parent | d51bdc166d144b3d81b01e2b97a5420978528e01 (diff) | |
download | lua-27c5b1b2370e730f2ccd1dcae88e3601035e40c4.tar.gz lua-27c5b1b2370e730f2ccd1dcae88e3601035e40c4.tar.bz2 lua-27c5b1b2370e730f2ccd1dcae88e3601035e40c4.zip |
added patches to two bugs
-rw-r--r-- | bugs | 41 |
1 files changed, 28 insertions, 13 deletions
@@ -1878,13 +1878,6 @@ for i=1,25 do print(i); crash(i) end | |||
1878 | patch = [[ | 1878 | patch = [[ |
1879 | --- lundump.c 2008/04/04 16:00:45 2.7.1.3 | 1879 | --- lundump.c 2008/04/04 16:00:45 2.7.1.3 |
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 @@ | ||
1882 | /* | ||
1883 | -** $Id: bugs,v 1.134 2015/02/09 17:57:45 roberto Exp roberto $ | ||
1884 | +** $Id: bugs,v 1.134 2015/02/09 17:57:45 roberto Exp roberto $ | ||
1885 | ** load precompiled Lua chunks | ||
1886 | ** See Copyright Notice in lua.h | ||
1887 | */ | ||
1888 | @@ -161,7 +161,9 @@ | 1881 | @@ -161,7 +161,9 @@ |
1889 | 1882 | ||
1890 | static Proto* LoadFunction(LoadState* S, TString* p) | 1883 | static Proto* LoadFunction(LoadState* S, TString* p) |
@@ -3220,6 +3213,26 @@ example = [[ | |||
3220 | (segfaults on some platforms with some compiler options) | 3213 | (segfaults on some platforms with some compiler options) |
3221 | ]], | 3214 | ]], |
3222 | patch = [[ | 3215 | patch = [[ |
3216 | --- ltablib.c 2013/04/12 18:48:47 1.65.1.1 | ||
3217 | +++ ltablib.c 2014/05/07 16:32:55 1.65.1.2 | ||
3218 | @@ -134,13 +135,14 @@ | ||
3219 | |||
3220 | |||
3221 | static int unpack (lua_State *L) { | ||
3222 | - int i, e, n; | ||
3223 | + int i, e; | ||
3224 | + unsigned int n; | ||
3225 | luaL_checktype(L, 1, LUA_TTABLE); | ||
3226 | i = luaL_optint(L, 2, 1); | ||
3227 | e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1)); | ||
3228 | if (i > e) return 0; /* empty range */ | ||
3229 | - n = e - i + 1; /* number of elements */ | ||
3230 | - if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ | ||
3231 | + n = (unsigned int)e - (unsigned int)i; /* number of elements minus 1 */ | ||
3232 | + if (n > (INT_MAX - 10) || !lua_checkstack(L, ++n)) | ||
3233 | return luaL_error(L, "too many results to unpack"); | ||
3234 | lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ | ||
3235 | while (i++ < e) /* push arg[i + 1...e] */ | ||
3223 | ]] | 3236 | ]] |
3224 | } | 3237 | } |
3225 | 3238 | ||
@@ -3284,6 +3297,14 @@ since = [[5.3]], | |||
3284 | fix = nil, | 3297 | fix = nil, |
3285 | example = [[string.format("%.99f", 1e4000) -- when floats are long double]], | 3298 | example = [[string.format("%.99f", 1e4000) -- when floats are long double]], |
3286 | patch = [[ | 3299 | patch = [[ |
3300 | --- lstrlib.c 2014/12/11 14:03:07 1.221 | ||
3301 | +++ lstrlib.c 2015/02/23 19:01:42 | ||
3302 | @@ -800,3 +800,4 @@ | ||
3303 | /* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ | ||
3304 | -#define MAX_ITEM 512 | ||
3305 | +#define MAX_ITEM \ | ||
3306 | + (sizeof(lua_Number) <= 4 ? 150 : sizeof(lua_Number) <= 8 ? 450 : 5050) | ||
3307 | |||
3287 | ]] | 3308 | ]] |
3288 | } | 3309 | } |
3289 | 3310 | ||
@@ -3297,12 +3318,6 @@ example = [[see http://lua-users.org/lists/lua-l/2015-02/msg00146.html]], | |||
3297 | patch = [[ | 3318 | patch = [[ |
3298 | --- ldebug.c 2015/01/02 12:52:22 2.110 | 3319 | --- ldebug.c 2015/01/02 12:52:22 2.110 |
3299 | +++ ldebug.c 2015/02/13 16:03:23 | 3320 | +++ ldebug.c 2015/02/13 16:03:23 |
3300 | @@ -1,4 +1,4 @@ | ||
3301 | /* | ||
3302 | -** $Id: ldebug.c,v 2.110 2015/01/02 12:52:22 roberto Exp $ | ||
3303 | +** $Id: ldebug.c,v 2.111 2015/02/13 16:01:17 roberto Exp $ | ||
3304 | ** Debug Interface | ||
3305 | ** See Copyright Notice in lua.h | ||
3306 | @@ -49,4 +49,14 @@ | 3321 | @@ -49,4 +49,14 @@ |
3307 | 3322 | ||
3308 | 3323 | ||