From: Vsevolod Stakhov Date: Tue, 19 Oct 2010 14:46:58 +0000 (+0400) Subject: Fixed bug with file urls (reported by Anton Nekhoroshin) X-Git-Tag: 0.3.3~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f23fd64a793f818300bb645beb16f1a01528d31;p=thirdparty%2Frspamd.git Fixed bug with file urls (reported by Anton Nekhoroshin) --- diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 452b590d56..1ebf78991a 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 77043bdc07..6806c0ea36 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;