diff options
author | Mark Pulford <mark@kyne.com.au> | 2012-01-19 20:13:25 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2012-03-04 18:54:35 +1030 |
commit | f62a3d368525b7b2d8f38b68178e1d277b247edf (patch) | |
tree | 5c879f9d6ddf97cc72d4684749f8faff24b61621 /devel | |
parent | 94e85ca17cc72550684e5c9543f8ffca86672de3 (diff) | |
download | lua-cjson-f62a3d368525b7b2d8f38b68178e1d277b247edf.tar.gz lua-cjson-f62a3d368525b7b2d8f38b68178e1d277b247edf.tar.bz2 lua-cjson-f62a3d368525b7b2d8f38b68178e1d277b247edf.zip |
Reserve stack slot for luaL_error() during encode
Unlike "decode", encoding leaves both the key/value on the stack before
descending. This leaves no spare room for luaL_error() in case the depth
check or lua_checkstack() fails. Allocate an extra stack slot to ensure there is always room for
luaL_error() in json_check_encode_depth().
Note: this would not have caused a crash or fault due to the EXTRA_STACK
slot reserve, but it was a misuse of the Lua C API.
Diffstat (limited to 'devel')
0 files changed, 0 insertions, 0 deletions