[xml] [PATCH resend] Fix XSD validation of URIs with ampersands
- From: Alex Henrie <alexhenrie24 gmail com>
- To: xml gnome org, veillard redhat com, wellnhofer aevum de, mcatanzaro gnome org
- Subject: [xml] [PATCH resend] Fix XSD validation of URIs with ampersands
- Date: Mon, 16 Nov 2015 11:53:48 -0700
For https://bugzilla.gnome.org/show_bug.cgi?id=709171
This makes xmlSchemaSAXHandleStartElementNs pass attributes through
xmlStringDecodeEntities, similar to how xmlSchemaVDocWalk passes them
through xmlNodeListGetString.
---
xmlschemas.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xmlschemas.c b/xmlschemas.c
index fe533e6..2cd2fb8 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -27382,10 +27382,10 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
for (j = 0, i = 0; i < nb_attributes; i++, j += 5) {
/*
- * Duplicate the value.
+ * Duplicate the value, changing & to a literal ampersand.
*/
- value = xmlStrndup(attributes[j+3],
- attributes[j+4] - attributes[j+3]);
+ value = xmlStringLenDecodeEntities(ctx, attributes[j+3],
+ attributes[j+4] - attributes[j+3], XML_SUBSTITUTE_REF, 0, 0, 0);
/*
* TODO: Set the node line.
*/
--
2.6.2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]