String handling truncates at null characters
Xaltonon opened this issue · comments
Xaltonon commented
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.
payonel commented
don't use strings, use vector
payonel commented
example: https://github.com/payonel/ocvm/blob/master/apis/unicode.cpp#L390
that's pushing a vector