From: Vsevolod Stakhov Date: Fri, 3 Jul 2020 11:25:46 +0000 (+0100) Subject: [Minor] Improve errors reporting X-Git-Tag: 2.6~269 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c2c057d2d46e79f69b4aa6879f87035b45ab329;p=thirdparty%2Frspamd.git [Minor] Improve errors reporting --- diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c index 425818977f..85acde5508 100644 --- a/src/lua/lua_cryptobox.c +++ b/src/lua/lua_cryptobox.c @@ -1284,8 +1284,13 @@ lua_cryptobox_hash_update (lua_State *L) len = nlen; } - if (h && !h->is_finished && data) { - rspamd_lua_hash_update (h, data, len); + if (h && data) { + if (!h->is_finished) { + rspamd_lua_hash_update (h, data, len); + } + else { + return luaL_error (L, "hash is already finalized"); + } } else { return luaL_error (L, "invalid arguments");