From: Vsevolod Stakhov Date: Mon, 3 Feb 2020 17:17:06 +0000 (+0000) Subject: [CritFix] Fix html entities decoding X-Git-Tag: 2.3~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3d0dd27030df359f17181c5f926fb500c119a962;p=rspamd.git [CritFix] Fix html entities decoding --- diff --git a/src/libserver/html.c b/src/libserver/html.c index 395987cce..668d1bdff 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -506,7 +506,7 @@ rspamd_html_decode_entitles_inplace (gchar *s, gsize len) /* Leftover */ if (state == 1 && h > e) { /* Unfinished entity, copy as is */ - if (end - t > h - e) { + if (end - t >= h - e) { memmove (t, e, h - e); t += h - e; } @@ -1511,7 +1511,7 @@ rspamd_html_process_url_tag (rspamd_mempool_t *pool, struct html_tag *tag, orig_len = len; len += hc->base_url->urllen; - if (hc->base_url->string[hc->base_url->urllen - 1] != '/') { + if (hc->base_url->datalen == 0) { need_slash = TRUE; len ++; }