diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-11-28 16:27:38 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-11-28 16:27:38 -0200 |
commit | abcc124df05fe19470abdb9d665160a7e3b01495 (patch) | |
tree | a1ee289114ba8105800d24c1b08a3725b8778690 /bugs | |
parent | b4164a9aa7760be7d66f90d6af5093b9ff26fb0c (diff) | |
download | lua-abcc124df05fe19470abdb9d665160a7e3b01495.tar.gz lua-abcc124df05fe19470abdb9d665160a7e3b01495.tar.bz2 lua-abcc124df05fe19470abdb9d665160a7e3b01495.zip |
BUG: lua_setfenv may crash if called over an invalid object
Diffstat (limited to 'bugs')
-rw-r--r-- | bugs | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1595,6 +1595,27 @@ ltablib.c: | |||
1595 | } | 1595 | } |
1596 | 1596 | ||
1597 | Bug{ | 1597 | Bug{ |
1598 | what = [[lua_setfenv may crash if called over an invalid object]], | ||
1599 | report = [[Mike Pall, on 11/2007]], | ||
1600 | since = [[5.1]], | ||
1601 | example = [[ | ||
1602 | > debug.setfenv(3, {}) | ||
1603 | ]], | ||
1604 | patch = [[ | ||
1605 | lapi.c: | ||
1606 | @@ -749,7 +749,7 @@ | ||
1607 | res = 0; | ||
1608 | break; | ||
1609 | } | ||
1610 | - luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); | ||
1611 | + if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); | ||
1612 | L->top--; | ||
1613 | lua_unlock(L); | ||
1614 | return res; | ||
1615 | ]], | ||
1616 | } | ||
1617 | |||
1618 | Bug{ | ||
1598 | what = [[ ]], | 1619 | what = [[ ]], |
1599 | report = [[ , on ]], | 1620 | report = [[ , on ]], |
1600 | since = [[i ]], | 1621 | since = [[i ]], |