aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-25 17:32:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-25 17:32:58 +0100
commite966950fb945eb2c5463dfcaa1fb197753003338 (patch)
tree4aab1e293e851a70856d8553948503d2933af75b
parent0632326add301a3be469ffa0fd48dd3178263c9b (diff)
downloadrspamd-e966950fb945eb2c5463dfcaa1fb197753003338.tar.gz
rspamd-e966950fb945eb2c5463dfcaa1fb197753003338.zip
[Minor] Fix small href values with a base urls presented
-rw-r--r--src/libserver/html/html.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx
index 715f831d5..ef7fb35ba 100644
--- a/src/libserver/html/html.cxx
+++ b/src/libserver/html/html.cxx
@@ -603,7 +603,7 @@ html_process_url_tag(rspamd_mempool_t *pool,
/* Check base url */
auto &href_value = found_href_maybe.value();
- if (hc && hc->base_url && href_value.size() > 2) {
+ if (hc && hc->base_url) {
/*
* Relative url cannot start from the following:
* schema://
@@ -638,7 +638,7 @@ html_process_url_tag(rspamd_mempool_t *pool,
(gint) orig_len, href_value.data());
href_value = {buf, nlen};
}
- else if (href_value[0] == '/' && href_value[1] != '/') {
+ else if (href_value.size() > 2 && href_value[0] == '/' && href_value[1] != '/') {
/* Relative to the hostname */
auto orig_len = href_value.size();
auto len = orig_len + hc->base_url->hostlen + hc->base_url->protocollen +