From: Vsevolod Stakhov Date: Mon, 24 Jun 2013 11:32:54 +0000 (+0100) Subject: Fix urls detection for strings with multiply dots. X-Git-Tag: 0.6.0~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bc758006df1e18a48eb06275fc8122020688d47;p=thirdparty%2Frspamd.git Fix urls detection for strings with multiply dots. --- diff --git a/src/url.c b/src/url.c index eb03198d7d..2cbd047aad 100644 --- a/src/url.c +++ b/src/url.c @@ -1217,6 +1217,16 @@ url_tld_start (const gchar *begin, const gchar *end, const gchar *pos, url_match match->m_begin = p; return TRUE; } + else if (*p == '.') { + if (p == begin) { + /* Urls cannot start with a dot */ + return FALSE; + } + if (!g_ascii_isalnum (p[1])) { + /* Wrong we have an invalid character after dot */ + return FALSE; + } + } p --; }