From: Vsevolod Stakhov Date: Mon, 26 Apr 2021 15:48:20 +0000 (+0100) Subject: [Minor] Do not decompress empty stream as zst behaves badly in this case X-Git-Tag: 3.0~461 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1dd413d7a092c432e032aac8c3dd46eee332aa1;p=thirdparty%2Frspamd.git [Minor] Do not decompress empty stream as zst behaves badly in this case --- diff --git a/src/lua/lua_compress.c b/src/lua/lua_compress.c index 8d2a7e70b0..5bebd0e0d9 100644 --- a/src/lua/lua_compress.c +++ b/src/lua/lua_compress.c @@ -545,6 +545,10 @@ lua_zstd_decompress_stream (lua_State *L) if (ctx && t) { gsize dlen = 0; + if (t->len == 0) { + return lua_zstd_push_error (L, ZSTD_error_init_missing); + } + inb.size = t->len; inb.pos = 0; inb.src = (const void*)t->start;