]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Check if we have any alnum character
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 26 Jul 2021 17:59:26 +0000 (18:59 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 26 Jul 2021 17:59:26 +0000 (18:59 +0100)
src/libserver/html/html.cxx

index 1d8206bbabc18bff47e1fce167d79d7c5837ead6..3ec90c5dda3fc7124ee95e44039fd90a42321716 100644 (file)
@@ -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;