From ab3dc8978f0c19beadf9fe41d93cc49230f11d52 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 16 Jul 2020 15:53:07 +0100 Subject: [PATCH] [Minor] Fix data images processing in html links --- src/libserver/html.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.39.5