Certain functions truncate at null characters when marshaling strings between Lua and C++. Both std::string and Lua strings may contain null characters, and this is relied on heavily when dealing with binary data in Lua. At least ValuePack::push_ret and Value::checkArg<string> do this, but I haven't had time to check the whole codebase.
I discovered this while implementing the datacard, thinking my cryptography library was broken. I'll submit a fix for the issues affecting that shortly.
Certain functions truncate at null characters when marshaling strings between Lua and C++. Both
std::string
and Lua strings may contain null characters, and this is relied on heavily when dealing with binary data in Lua. At leastValuePack::push_ret
andValue::checkArg<string>
do this, but I haven't had time to check the whole codebase.I discovered this while implementing the datacard, thinking my cryptography library was broken. I'll submit a fix for the issues affecting that shortly.