From: Vsevolod Stakhov Date: Tue, 14 Mar 2017 14:23:48 +0000 (+0000) Subject: [Fix] Do not reallocate completed zstd buffer X-Git-Tag: 1.5.3~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=43763bea31d65241263b23ff6fda3fc47f51bd6e;p=rspamd.git [Fix] Do not reallocate completed zstd buffer --- diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index 064aa53f8..3ca34b4cc 100644 --- a/src/lua/lua_util.c +++ b/src/lua/lua_util.c @@ -1790,7 +1790,7 @@ lua_util_zstd_decompress (lua_State *L) return 2; } - if (zout.pos == zout.size) { + if (zin.pos < zin.size && zout.pos == zout.size) { /* We need to extend output buffer */ zout.size = zout.size * 1.5 + 1.0; out = g_realloc (zout.dst, zout.size);