aboutsummaryrefslogtreecommitdiffstats
path: root/src/url.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-24 12:32:54 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-24 12:32:54 +0100
commit1bc758006df1e18a48eb06275fc8122020688d47 (patch)
treed1339356f13d70eee980f95a62d4ef2885d48c62 /src/url.c
parent62238026d4230392c8383db90b969cbdc8d4166c (diff)
downloadrspamd-1bc758006df1e18a48eb06275fc8122020688d47.tar.gz
rspamd-1bc758006df1e18a48eb06275fc8122020688d47.zip
Fix urls detection for strings with multiply dots.
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/url.c b/src/url.c
index eb03198d7..2cbd047aa 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 --;
}