]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix logic of finding slashless urls
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 25 Feb 2019 18:32:15 +0000 (18:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 25 Feb 2019 18:32:15 +0000 (18:32 +0000)
src/libserver/html.c

index 6840b9a1ad8d81c7e0c360f7afe276729c65b82d..31438ddad617165072f40f4cef24328bebbe75fb 100644 (file)
@@ -1366,21 +1366,24 @@ rspamd_html_process_url (rspamd_mempool_t *pool, const gchar *start, guint len,
                                                dlen += sizeof ("mailto://") - 1;
                                                no_prefix = TRUE;
                                        }
+                                       else if (s[i] == ':' && i != 0) {
+                                               /* Special case */
+                                               no_prefix = FALSE;
+                                       }
                                        else {
                                                if (i == 0) {
                                                        /* No valid data */
                                                        return NULL;
                                                }
+                                               else {
+                                                       no_prefix = TRUE;
+                                                       dlen += strlen (prefix);
+                                               }
                                        }
 
                                        break;
                                }
                        }
-
-                       if (!no_prefix) {
-                               no_prefix = TRUE;
-                               dlen += strlen (prefix);
-                       }
                }
        }