diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-18 13:53:15 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-18 13:53:15 +0200 |
commit | ffe3c2ae0db6fed0f2b08b71bfa69f3d3df3bb1f (patch) | |
tree | cc7d9f74a43215c5d8e3965a2bfc2aea5867a7a0 /src/script/lua_api/l_util.cpp | |
parent | 45aa2516b2fc675df7049bc9ed713600c95b6423 (diff) | |
parent | 82731d0d3d8bfe9e56f89466991f13c037f3a61e (diff) | |
download | dragonfireclient-ffe3c2ae0db6fed0f2b08b71bfa69f3d3df3bb1f.tar.xz |
Update to minetest 5.4.0-dev
Diffstat (limited to 'src/script/lua_api/l_util.cpp')
-rw-r--r-- | src/script/lua_api/l_util.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index 75cd1dacf..99a006ec1 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -44,7 +44,7 @@ with this program; if not, write to the Free Software Foundation, Inc., // log([level,] text) // Writes a line to the logger. -// The one-argument version logs to infostream. +// The one-argument version logs to LL_NONE. // The two-argument version accepts a log level. // Either the special case "deprecated" for deprecation notices, or any specified in // Logger::stringToLevel(name). @@ -318,9 +318,13 @@ int ModApiUtil::l_decode_base64(lua_State *L) NO_MAP_LOCK_REQUIRED; size_t size; - const char *data = luaL_checklstring(L, 1, &size); + const char *d = luaL_checklstring(L, 1, &size); + const std::string data = std::string(d, size); + + if (!base64_is_valid(data)) + return 0; - std::string out = base64_decode(std::string(data, size)); + std::string out = base64_decode(data); lua_pushlstring(L, out.data(), out.size()); return 1; |