]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix parsing of unquoted HTML attributes
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Nov 2016 09:54:07 +0000 (12:54 +0300)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Nov 2016 09:54:47 +0000 (12:54 +0300)
Issue: #1092
Reported by: @moisseev

src/libserver/html.c

index d36b8d6db6c3eb52ba76b895d8ec631e6cef7a51..94ac6915f89e6ef495376dc17eacc0c4af839998 100644 (file)
@@ -1178,13 +1178,15 @@ rspamd_html_parse_tag_content (rspamd_mempool_t *pool,
                break;
 
        case parse_value:
-               if (g_ascii_isspace (*in) || *in == '>' || *in == '/') {
-                       if (*in == '/') {
-                               tag->flags |= FL_CLOSED;
-                       }
+               if (*in == '/' && *(in + 1) == '>') {
+                       tag->flags |= FL_CLOSED;
+                       store = TRUE;
+               }
+               else if (g_ascii_isspace (*in) || *in == '>') {
                        store = TRUE;
                        state = spaces_after_param;
                }
+
                if (store) {
                        if (*savep != NULL) {
                                g_assert (tag->params != NULL);