glib2/gmarkup-Fix-validation-of-element-names.patch

38 lines
1.2 KiB
Diff
Raw Normal View History

2019-09-30 10:40:42 -04:00
From 2187b1bec481b4d87310792c46d7d9ea59957f07 Mon Sep 17 00:00:00 2001
From: Philip Withnall <withnall@endlessm.com>
Date: Fri, 26 Oct 2018 23:21:46 +1300
Subject: [PATCH 190/682] 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,
--
2.19.1