From f7aee39a9dc81ae437e1dcc651a7335a7ae071d3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 13 Mar 2019 15:01:18 +0000 Subject: [Fix] Fix various issues found by PVS Studio https://www.viva64.com/ --- src/lua/lua_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lua/lua_util.c') diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index d78e230e7..dad8c336b 100644 --- a/src/lua/lua_util.c +++ b/src/lua/lua_util.c @@ -1177,7 +1177,7 @@ lua_util_tokenize_text (lua_State *L) { LUA_TRACE_POINT; const gchar *in = NULL; - gsize len, pos, ex_len, i; + gsize len = 0, pos, ex_len, i; GList *exceptions = NULL, *cur; struct rspamd_lua_text *t; struct rspamd_process_exception *ex; @@ -2243,6 +2243,8 @@ lua_util_gzip_decompress (lua_State *L) return luaL_error (L, "invalid arguments"); } + sz = t->len; + memset (&strm, 0, sizeof (strm)); /* windowBits +16 to decode gzip, zlib 1.2.0.4+ */ rc = inflateInit2 (&strm, MAX_WBITS + 16); -- cgit v1.2.3