From: Vsevolod Stakhov Date: Mon, 26 Jul 2021 17:59:26 +0000 (+0100) Subject: [Minor] Check if we have any alnum character X-Git-Tag: 3.0~96 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d04d853075c827d504bfcb56846fbdc3563b9f65;p=rspamd.git [Minor] Check if we have any alnum character --- diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index 1d8206bba..3ec90c5dd 100644 --- a/src/libserver/html/html.cxx +++ b/src/libserver/html/html.cxx @@ -573,7 +573,7 @@ html_is_absolute_url(std::string_view st) -> bool auto alnum_pos = std::find_if(std::begin(st), std::end(st), [](auto c) {return !g_ascii_isalnum(c);}); - if (alnum_pos != std::end(st)) { + if (alnum_pos != std::end(st) && alnum_pos != std::begin(st)) { if (*alnum_pos == ':') { if (st.substr(0, std::distance(std::begin(st), alnum_pos)) == "mailto") { return true;