diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-07-03 12:25:46 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-07-03 12:25:46 +0100 |
commit | 3c2c057d2d46e79f69b4aa6879f87035b45ab329 (patch) | |
tree | fca8453a4270973bfb3a97a081407e9acff63107 /src/lua | |
parent | 315bf9d19c5a3538e4df38bff853dc473e343384 (diff) | |
download | rspamd-3c2c057d2d46e79f69b4aa6879f87035b45ab329.tar.gz rspamd-3c2c057d2d46e79f69b4aa6879f87035b45ab329.zip |
[Minor] Improve errors reporting
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_cryptobox.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lua/lua_cryptobox.c b/src/lua/lua_cryptobox.c index 425818977..85acde550 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"); |