From: Vsevolod Stakhov Date: Thu, 16 Jul 2020 14:53:07 +0000 (+0100) Subject: [Minor] Fix data images processing in html links X-Git-Tag: 2.6~237 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ab3dc8978f0c19beadf9fe41d93cc49230f11d52;p=rspamd.git [Minor] Fix data images processing in html links --- diff --git a/src/libserver/html.c b/src/libserver/html.c index 37c8858bd..e5e43aed6 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -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;