]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve errors reporting
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Jul 2020 11:25:46 +0000 (12:25 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Jul 2020 11:25:46 +0000 (12:25 +0100)
src/lua/lua_cryptobox.c

index 425818977f4ab560a7065e3181eeb8df5b4ef85c..85acde550872d23f68aa958bb11c000ed98e9a34 100644 (file)
@@ -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");