]> source.dussan.org Git - rspamd.git/commitdiff
Try to fix bug with absent trie items in redirectors list.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 15 Nov 2010 17:03:56 +0000 (20:03 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 15 Nov 2010 17:03:56 +0000 (20:03 +0300)
src/plugins/surbl.c

index 1ebf78991a33b9fed562f9c19952fd628a55e990..8627cbbcaa1344da46afa62196c5f2c504110ce5 100644 (file)
@@ -900,7 +900,8 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data)
                f.len = url->hostlen;
                /* Search in trie */
                if (surbl_module_ctx->redirector_trie &&
-                               rspamd_trie_lookup (surbl_module_ctx->redirector_trie, url->host, url->hostlen, &idx)) {
+                               rspamd_trie_lookup (surbl_module_ctx->redirector_trie, url->host, url->hostlen, &idx) &&
+                               idx < surbl_module_ctx->redirector_ptrs->len) {
                        /* Get corresponding prefix */
                        red_domain = g_ptr_array_index (surbl_module_ctx->redirector_ptrs, idx);
                        /* Try to find corresponding regexp */