[libxslt] Check name vales for attribute-set elements



commit 71691d7b991db8a88824ddeb71a7edc28ecc0cb0
Author: Daniel Veillard <veillard redhat com>
Date:   Mon Jun 29 18:22:36 2015 +0800

    Check name vales for attribute-set elements
    
    For https://bugzilla.gnome.org/show_bug.cgi?id=751633
    
    It has to be a qname and we didn't check for empty strings,
    this could raise an infinite loop at compilation too

 libxslt/attributes.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libxslt/attributes.c b/libxslt/attributes.c
index 2fa86e3..2530cf5 100644
--- a/libxslt/attributes.c
+++ b/libxslt/attributes.c
@@ -297,9 +297,11 @@ xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur) {
        return;
 
     value = xmlGetNsProp(cur, (const xmlChar *)"name", NULL);
-    if (value == NULL) {
+    if ((value == NULL) || (*value == 0)) {
        xsltGenericError(xsltGenericErrorContext,
             "xsl:attribute-set : name is missing\n");
+        if (value)
+           xmlFree(value);
        return;
     }
 
@@ -495,6 +497,8 @@ xsltResolveSASCallback(xsltAttrElemPtr values, xsltStylesheetPtr style,
     xsltAttrElemPtr refs;
 
     tmp = values;
+    if ((name == NULL) || (name[0] == 0))
+        return;
     while (tmp != NULL) {
        if (tmp->set != NULL) {
            /*


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