浏览代码

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

bel2125 2 年之前
父节点
当前提交
f0b9514c23
共有 1 个文件被更改,包括 1 次插入1 次删除
  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,
 				                 dst,
 				                 &dst_len);
-				lua_pushlstring(L, dst, dst_len);
+				lua_pushstring(L, dst);
 				mg_free(dst);
 			} else {
 				return luaL_error(L, "out of memory in base64_encode() call");