From 2f23fd64a793f818300bb645beb16f1a01528d31 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 19 Oct 2010 18:46:58 +0400 Subject: [PATCH] Fixed bug with file urls (reported by Anton Nekhoroshin) --- src/plugins/surbl.c | 3 +++ src/protocol.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 452b590d5..1ebf78991 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -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; diff --git a/src/protocol.c b/src/protocol.c index 77043bdc0..6806c0ea3 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -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; -- 2.39.5