summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-03 17:17:06 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-03 17:17:06 +0000
commit3d0dd27030df359f17181c5f926fb500c119a962 (patch)
treebec96fc09ba9eb0ffcba1c1d10b23a18d47ac146 /src
parent87def67d9785d4bd109ac875b02a253f0eaa4849 (diff)
downloadrspamd-3d0dd27030df359f17181c5f926fb500c119a962.tar.gz
rspamd-3d0dd27030df359f17181c5f926fb500c119a962.zip
[CritFix] Fix html entities decoding
Diffstat (limited to 'src')
-rw-r--r--src/libserver/html.c4
1 files changed, 2 insertions, 2 deletions
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 ++;
}