aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/html.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-07-16 15:53:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-07-16 15:53:07 +0100
commitab3dc8978f0c19beadf9fe41d93cc49230f11d52 (patch)
tree76da598afaf1e8dd43bd402263c92cab2fe8040a /src/libserver/html.c
parent388dd3f53f65474c73cdeea675ce9569692da371 (diff)
downloadrspamd-ab3dc8978f0c19beadf9fe41d93cc49230f11d52.tar.gz
rspamd-ab3dc8978f0c19beadf9fe41d93cc49230f11d52.zip
[Minor] Fix data images processing in html links
Diffstat (limited to 'src/libserver/html.c')
-rw-r--r--src/libserver/html.c8
1 files 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;