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;
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;
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;
cases = {
{'http://example.net/?arg=%23#fragment', true, {
- host = 'example.net', fragment = 'fragment'
+ host = 'example.net', fragment = 'fragment', query = 'arg=#',
}},
{"http:/\\[::eeee:192.168.0.1]/#test", true, {
host = '::eeee:c0a8:1', fragment = 'test'