From: bert hubert Date: Mon, 1 Feb 2016 06:29:58 +0000 (+0100) Subject: LuaWrapper turned out not to have been 0-byte clean when pushing std::strings from... X-Git-Tag: dnsdist-1.0.0-alpha2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0c3971a766b3ace475f84a9c5a693e453a0711f;p=thirdparty%2Fpdns.git LuaWrapper turned out not to have been 0-byte clean when pushing std::strings from C++! --- diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index f247eef7a8..8efccd41b7 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -1849,7 +1849,7 @@ struct LuaContext::Pusher { static const int maxSize = 1; static PushedObject push(lua_State* state, const std::string& value) noexcept { - lua_pushstring(state, value.c_str()); + lua_pushlstring(state, value.c_str(), value.length()); return PushedObject{state, 1}; } };