]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not reallocate completed zstd buffer
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 14 Mar 2017 14:23:48 +0000 (14:23 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 14 Mar 2017 14:39:50 +0000 (14:39 +0000)
src/lua/lua_util.c

index 064aa53f8797bf5734ffc6a18e271ee707f505ed..3ca34b4ccce2e90e13373cb59c6edf0e4d3a7f0a 100644 (file)
@@ -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);