]> source.dussan.org Git - rspamd.git/commitdiff
Fixed bug with file urls (reported by Anton Nekhoroshin)
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 19 Oct 2010 14:46:58 +0000 (18:46 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 19 Oct 2010 14:46:58 +0000 (18:46 +0400)
src/plugins/surbl.c
src/protocol.c

index 452b590d56dbf9d0915e6159e3fb3837d984e050..1ebf78991a33b9fed562f9c19952fd628a55e990 100644 (file)
@@ -891,6 +891,9 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data)
 
        debug_task ("check url %s", struri (url));
 
+       if (url->hostlen <= 0) {
+               return FALSE;
+       }
 
        if (surbl_module_ctx->use_redirector) {
                f.begin = url->host;
index 77043bdc073ec6aeb1cc4a5a4014d4126f73e5d0..6806c0ea363d01419166c10408468742ec178827 100644 (file)
@@ -488,7 +488,7 @@ show_url_header (struct worker_task *task)
             /* Write this url to log as well */
             msg_info ("url found: <%s>, score: [%.2f / %.2f]", struri (url), default_score, default_required_score);
         }
-               if (g_tree_lookup (url_tree, url) == NULL) {
+               if (g_tree_lookup (url_tree, url) == NULL && url->hostlen > 0) {
                        g_tree_insert (url_tree, url, url);
                        host.begin = url->host;
                        host.len = url->hostlen;