]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix dns resolve with no current item
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 24 Oct 2018 09:30:38 +0000 (10:30 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 24 Oct 2018 09:30:38 +0000 (10:30 +0100)
src/libcryptobox/base64/ref.c
src/lua/lua_dns_resolver.c

index 797a91ce7bb9acef4fb4c869c5761e87ef9cf299..6d3c295f174592b83912aade365c4c2a3d0b2771 100644 (file)
@@ -214,7 +214,7 @@ repeat:
        }
 
        if (!ret && inlen > 0) {
-               /* Skip to the next valid character in input */
+               /* Skip to the next valid character in lua_dns_resolver_resolve_commoninput */
                while (inlen > 0 && base64_table_dec[*c] >= 254) {
                        c ++;
                        inlen --;
index 8a49fdfaf6aed728d5220195d2862355bf3b56bc..d00aaa6a2aaa37610ce618cbc3c7f2cff6a4dda2 100644 (file)
@@ -455,7 +455,10 @@ lua_dns_resolver_resolve_common (lua_State *L,
                        if (ret) {
                                cbdata->s = session;
                                cbdata->item = rspamd_symbols_cache_get_cur_item (task);
-                               rspamd_symcache_item_async_inc (task, cbdata->item);
+
+                               if (cbdata->item) {
+                                       rspamd_symcache_item_async_inc (task, cbdata->item);
+                               }
                                /* callback was set up */
                                lua_pushboolean (L, TRUE);
                        } else {