]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Avoid FP when a protocol prefix is implicitly added
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Apr 2021 20:23:43 +0000 (21:23 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Apr 2021 20:23:43 +0000 (21:23 +0100)
src/libserver/html.c

index 5e29b3b84545760b65b596ec9fb156de3a6b640d..137907183184e0639e2f26166ba100869e1eec69 100644 (file)
@@ -837,8 +837,8 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool,
                         */
                        gboolean obfuscation_found = FALSE;
 
-                       if (g_ascii_strncasecmp (url_str, "http", 4) == 0 &&
-                               strstr (url_str, "://") != NULL) {
+                       if (len > 4 && g_ascii_strncasecmp (url_text, "http", 4) == 0 &&
+                               rspamd_substring_search (url_text, len,"://", 3) != -1) {
                                /* Clearly an obfuscation attempt */
                                obfuscation_found = TRUE;
                        }