]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix parsing of the compound mailto urls
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Nov 2021 21:54:30 +0000 (21:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 17 Nov 2021 21:54:30 +0000 (21:54 +0000)
src/libserver/url.c

index a56ee8b175cf17e54809e4567e7acf0d88b80069..169b9b10766be8029217614b7dad3d61c0cff819 100644 (file)
@@ -854,9 +854,30 @@ rspamd_mailto_parse (struct http_parser_url *u,
                                st = parse_query;
                                break;
                        case parse_query:
-                               if (!is_mailsafe (t)) {
+                               if (t == '#') {
+                                       if (p - c != 0) {
+                                               SET_U (u, UF_QUERY);
+                                       }
+                                       c = p + 1;
+                                       ret = 0;
+
                                        goto out;
                                }
+                               else if (!(parse_flags & RSPAMD_URL_PARSE_HREF) && is_url_end (t)) {
+                                       ret = 0;
+                                       goto out;
+                               }
+                               else if (is_lwsp (t)) {
+                                       if (!(parse_flags & RSPAMD_URL_PARSE_CHECK)) {
+                                               if (g_ascii_isspace (t)) {
+                                                       ret = 0;
+                                               }
+                                               goto out;
+                                       }
+                                       else {
+                                               goto out;
+                                       }
+                               }
                                p++;
                                break;
                }