[glib: 4/6] gmarkup: Fix validation of element names



commit 2187b1bec481b4d87310792c46d7d9ea59957f07
Author: Philip Withnall <withnall endlessm com>
Date:   Fri Oct 26 23:21:46 2018 +1300

    gmarkup: Fix validation of element names
    
    Previously, the element name validation only happened if a start_element
    callback was specified on the context. Element name validation should be
    unconditional.
    
    This was causing test-5.gmarkup to fail when run against the improved
    tests in the following commit.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 glib/gmarkup.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/glib/gmarkup.c b/glib/gmarkup.c
index f85c00ab4..7093a6790 100644
--- a/glib/gmarkup.c
+++ b/glib/gmarkup.c
@@ -1050,8 +1050,10 @@ emit_start_element (GMarkupParseContext  *context,
   tmp_error = NULL;
   start_name = current_element (context);
 
-  if (context->parser->start_element &&
-      name_validate (context, start_name, error))
+  if (!name_validate (context, start_name, error))
+    return;
+
+  if (context->parser->start_element)
     (* context->parser->start_element) (context,
                                         start_name,
                                         (const gchar **)attr_names,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]