payonel / ocvm

OpenComputer Emulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

String handling truncates at null characters

Xaltonon opened this issue · comments

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.

don't use strings, use vector