<HTML><BODY><div>
<div>Missed something.</div>

<div> </div>

<div>Issue:</div>

<div><a href="https://github.com/tarantool/tarantool/issues/4637">https://github.com/tarantool/tarantool/issues/4637</a></div>

<div>Branch:</div>

<div><a href="https://github.com/tarantool/tarantool/compare/eljashm/gh-4637-json-stack-use-after-scope">https://github.com/tarantool/tarantool/compare/eljashm/gh-4637-json-stack-use-after-scope</a></div>

<div> </div>

<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Суббота, 30 ноября 2019, 0:36 +03:00 от Maria <maria.khaydich@tarantool.org>:<br>
 
<div id="">
<div class="js-helper js-readmsg-msg">
<style type="text/css">
</style>
<div>
<div id="style_15750633911151702424_BODY">Json decode method allocated serializer struct on stack and referenced<br>
it after scope.<br>
<br>
Thanks to @Korablev77 for the initial investigation.<br>
<br>
Closes #4637<br>
---<br>
 third_party/lua-cjson/lua_cjson.c | 6 +++---<br>
 1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/third_party/lua-cjson/lua_cjson.c b/third_party/lua-cjson/lua_cjson.c<br>
index 3d7edbf28..3d25814f3 100644<br>
--- a/third_party/lua-cjson/lua_cjson.c<br>
+++ b/third_party/lua-cjson/lua_cjson.c<br>
@@ -1005,10 +1005,10 @@ static int json_decode(lua_State *l)<br>
                   "expected 1 or 2 arguments");<br>
 <br>
     if (lua_gettop(l) == 2) {<br>
- struct luaL_serializer user_cfg = *luaL_checkserializer(l);<br>
- luaL_serializer_parse_options(l, &user_cfg);<br>
+ struct luaL_serializer *user_cfg = luaL_checkserializer(l);<br>
+ luaL_serializer_parse_options(l, user_cfg);<br>
         lua_pop(l, 1);<br>
- json.cfg = &user_cfg;<br>
+ json.cfg = user_cfg;<br>
     } else {<br>
         json.cfg = luaL_checkserializer(l);<br>
     }<br>
--<br>
2.20.1 (Apple Git-117)<br>
 </div>
</div>
</div>
</div>
</blockquote>
 

<div> </div>

<div data-signature-widget="container">
<div data-signature-widget="content">
<div>--<br>
Maria Khaydich</div>
</div>
</div>

<div> </div>
</div>
</BODY></HTML>