aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/protocol.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-06 12:01:37 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-09 10:46:11 +0000
commitcd270c51b2ccd814804e4f17eb31dc7d91a69980 (patch)
treed13caf7603d7817364e2f297da0ffad4f81a83a5 /src/libserver/protocol.c
parentf1d8615a328e2e7361445bcc91d96d2d42cddbb8 (diff)
downloadrspamd-cd270c51b2ccd814804e4f17eb31dc7d91a69980.tar.gz
rspamd-cd270c51b2ccd814804e4f17eb31dc7d91a69980.zip
[Rework] Rework URL structure: host field
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r--src/libserver/protocol.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 4c1a94d99..16dc05491 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -882,7 +882,7 @@ rspamd_protocol_extended_url (struct rspamd_task *task,
ucl_object_insert_key (obj, elt, "tld", 0, false);
}
if (url->hostlen > 0) {
- elt = ucl_object_fromstring_common (url->host, url->hostlen, 0);
+ elt = ucl_object_fromstring_common (rspamd_url_host_unsafe (url), url->hostlen, 0);
ucl_object_insert_key (obj, elt, "host", 0, false);
}
@@ -925,11 +925,14 @@ urls_protocol_cb (gpointer key, gpointer value, gpointer ud)
goffset err_offset;
- if ((err_offset = rspamd_fast_utf8_validate (url->host, url->hostlen)) == 0) {
- obj = ucl_object_fromstring_common (url->host, url->hostlen, 0);
+ if ((err_offset = rspamd_fast_utf8_validate (rspamd_url_host_unsafe (url),
+ url->hostlen)) == 0) {
+ obj = ucl_object_fromstring_common (rspamd_url_host_unsafe (url),
+ url->hostlen, 0);
}
else {
- obj = ucl_object_fromstring_common (url->host, err_offset - 1, 0);
+ obj = ucl_object_fromstring_common (rspamd_url_host_unsafe (url),
+ err_offset - 1, 0);
}
}
else {