diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-03-06 14:03:20 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-03-09 10:46:11 +0000 |
commit | a8f11faf7f584916078d6fadb36e0c2f1984e2b0 (patch) | |
tree | 1f7b00067a856148b01c4e017442297957da9b84 /src/libserver/html.c | |
parent | 3e3b94276f03f520bcd1756876c1077f250127d9 (diff) | |
download | rspamd-a8f11faf7f584916078d6fadb36e0c2f1984e2b0.tar.gz rspamd-a8f11faf7f584916078d6fadb36e0c2f1984e2b0.zip |
[Rework] Rework URL structure: adjust tld part
Diffstat (limited to 'src/libserver/html.c')
-rw-r--r-- | src/libserver/html.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c index e1a211d2c..981141ad8 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -704,14 +704,14 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool, /* Apply the same logic for TLD */ disp_tok.len = text_url->tldlen; - disp_tok.begin = text_url->tld; + disp_tok.begin = rspamd_url_tld_unsafe (text_url); #if U_ICU_VERSION_MAJOR_NUM >= 46 - if (rspamd_substring_search_caseless (text_url->tld, + if (rspamd_substring_search_caseless (rspamd_url_tld_unsafe (text_url), text_url->tldlen, "xn--", 4) != -1) { idn_hbuf = rspamd_mempool_alloc (pool, text_url->tldlen * 2 + 1); /* We need to convert it to the normal value first */ disp_tok.len = uidna_nameToUnicodeUTF8 (udn, - text_url->tld, text_url->tldlen, + rspamd_url_tld_unsafe (text_url), text_url->tldlen, idn_hbuf, text_url->tldlen * 2 + 1, &uinfo, &uc_err); if (uc_err != U_ZERO_ERROR) { @@ -725,14 +725,14 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool, } #endif href_tok.len = href_url->tldlen; - href_tok.begin = href_url->tld; + href_tok.begin = rspamd_url_tld_unsafe (href_url); #if U_ICU_VERSION_MAJOR_NUM >= 46 - if (rspamd_substring_search_caseless (href_url->tld, + if (rspamd_substring_search_caseless (rspamd_url_tld_unsafe (href_url), href_url->tldlen, "xn--", 4) != -1) { idn_hbuf = rspamd_mempool_alloc (pool, href_url->tldlen * 2 + 1); /* We need to convert it to the normal value first */ href_tok.len = uidna_nameToUnicodeUTF8 (udn, - href_url->tld, href_url->tldlen, + rspamd_url_tld_unsafe (href_url), href_url->tldlen, idn_hbuf, href_url->tldlen * 2 + 1, &uinfo, &uc_err); if (uc_err != U_ZERO_ERROR) { |