aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/url.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-15 11:21:56 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-15 11:21:56 +0000
commit092fa9c14831bc0460bd25190fa013697f572354 (patch)
treeabaff464b106edbc5c694f0e389f241a38bc06c7 /src/libserver/url.c
parent5d6f92884a1264d4080b00994090508189e2ead8 (diff)
downloadrspamd-092fa9c14831bc0460bd25190fa013697f572354.tar.gz
rspamd-092fa9c14831bc0460bd25190fa013697f572354.zip
[Fix] Fix urls shifting when doing decode to include separators
Diffstat (limited to 'src/libserver/url.c')
-rw-r--r--src/libserver/url.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c
index d792177e8..866cb4c22 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -1810,7 +1810,7 @@ rspamd_url_shift (struct rspamd_url *uri, gsize nlen,
old_shift = uri->hostlen;
uri->hostlen -= shift;
memmove (uri->host + uri->hostlen, uri->host + old_shift,
- uri->datalen + uri->querylen + uri->fragmentlen);
+ uri->datalen + uri->querylen + uri->fragmentlen + 1);
uri->urllen -= shift;
uri->flags |= RSPAMD_URL_FLAG_HOSTENCODED;
break;
@@ -1825,7 +1825,7 @@ rspamd_url_shift (struct rspamd_url *uri, gsize nlen,
old_shift = uri->datalen;
uri->datalen -= shift;
memmove (uri->data + uri->datalen, uri->data + old_shift,
- uri->querylen + uri->fragmentlen);
+ uri->querylen + uri->fragmentlen + 1);
uri->urllen -= shift;
uri->flags |= RSPAMD_URL_FLAG_PATHENCODED;
break;
@@ -1840,7 +1840,7 @@ rspamd_url_shift (struct rspamd_url *uri, gsize nlen,
old_shift = uri->querylen;
uri->querylen -= shift;
memmove (uri->query + uri->querylen, uri->query + old_shift,
- uri->fragmentlen);
+ uri->fragmentlen + 1);
uri->urllen -= shift;
uri->flags |= RSPAMD_URL_FLAG_QUERYENCODED;
break;