lua: use lua_pushfstring() instead of tt_sprintf()
In a few places to push a formatted string was used 2 calls: tt_sprintf() + lua_pushstring(). It wasn't necessary because Lua API has lua_pushfstring() with a big enough subset of printf format features. But more importantly - it was a bug. lua_pushstring() is a GC point. Before copying the passed string it tries to invoke Lua GC, which might invoke a __gc handler for some cdata, where static alloc might be used, and it can rewrite the string passed to lua_pushstring() in the beginning of the stack. Part of #5632
Loading
Please register or sign in to comment