Browse Source

Lua base64 decoding: Do not add terminating zero to Lua string

bel2125 2 years ago
parent
commit
f0b9514c23
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/mod_lua.inl

+ 1 - 1
src/mod_lua.inl

@@ -1527,7 +1527,7 @@ lsp_base64_encode(lua_State *L)
 				                 (int)text_len,
 				                 (int)text_len,
 				                 dst,
 				                 dst,
 				                 &dst_len);
 				                 &dst_len);
-				lua_pushlstring(L, dst, dst_len);
+				lua_pushstring(L, dst);
 				mg_free(dst);
 				mg_free(dst);
 			} else {
 			} else {
 				return luaL_error(L, "out of memory in base64_encode() call");
 				return luaL_error(L, "out of memory in base64_encode() call");