]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix data images processing in html links
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jul 2020 14:53:07 +0000 (15:53 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jul 2020 14:53:07 +0000 (15:53 +0100)
src/libserver/html.c

index 37c8858bd72d756aacbb996504e39ae2fd21c95c..e5e43aed68b1a5652e909638066b531010d6d1e6 100644 (file)
@@ -1574,14 +1574,18 @@ rspamd_html_process_url_tag (rspamd_mempool_t *pool, struct html_tag *tag,
                        /* Check base url */
                        if (hc && hc->base_url && comp->len > 2) {
                                /*
-                                * Relative url canot start from the following:
+                                * Relative url cannot start from the following:
                                 * schema://
+                                * data:
                                 * slash
                                 */
                                gchar *buf;
                                gsize orig_len;
 
-                               if (rspamd_substring_search (start, len, "://", 3) == -1) {
+                               if (rspamd_substring_search (start, len, "://", 3) == -1 &&
+                                       (len >= sizeof ("data:") &&
+                                        g_ascii_strncasecmp (start, "data:", sizeof ("data:") - 1) != 0)) {
+
                                        /* Assume relative url */
 
                                        gboolean need_slash = FALSE;