Closed jphickey closed 1 year ago
The conversion uses a LuaL_Buffer to temporarily hold the output object. The capacity of this object depends on Lua compile time configuration LUAL_BUFFERSIZE, which defaults to 8192 bytes.
LuaL_Buffer
LUAL_BUFFERSIZE
The call to this function will (properly) fail if the buffer is too small: https://github.com/nasa/EdsLib/blob/7dac5fd76bc08c4b40d09be47a0c4376e162581e/edslib/lua/src/edslib_lua_objects.c#L756
However, the result is not checked, and it still calls luaL_addsize with the too-large size and attempts to push the result, which is invalid.
luaL_addsize
This causes problems when attempting to generate tables for LC and DS. For example LC has a table that is about 17kB in size.
The conversion uses a
LuaL_Buffer
to temporarily hold the output object. The capacity of this object depends on Lua compile time configurationLUAL_BUFFERSIZE
, which defaults to 8192 bytes.The call to this function will (properly) fail if the buffer is too small: https://github.com/nasa/EdsLib/blob/7dac5fd76bc08c4b40d09be47a0c4376e162581e/edslib/lua/src/edslib_lua_objects.c#L756
However, the result is not checked, and it still calls
luaL_addsize
with the too-large size and attempts to push the result, which is invalid.This causes problems when attempting to generate tables for LC and DS. For example LC has a table that is about 17kB in size.