From: William M. Brack Date: Thu, 29 Jan 2004 22:08:52 +0000 (+0000) Subject: added validation of QName for xsl:element and xsl:attribute (Bug 132531) X-Git-Tag: v1.1.28~501 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f76974ba96404f5243fbe7dbd8e6c8ea9003c37e;p=platform%2Fupstream%2Flibxslt.git added validation of QName for xsl:element and xsl:attribute (Bug 132531) * libxslt/transform.c, libxslt/attributes.c: added validation of QName for xsl:element and xsl:attribute (Bug 132531) --- diff --git a/ChangeLog b/ChangeLog index 0fd6115..4cd5743 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 29 14:08:31 PST 2004 William Brack + + * libxslt/transform.c, libxslt/attributes.c: added + validation of QName for xsl:element and xsl:attribute + (Bug 132531) + Fri Jan 23 18:52:22 HKT 2004 William Brack * libxslt/pattern.c: changed priority of template patterns diff --git a/libxslt/attributes.c b/libxslt/attributes.c index aacac9f..6931130 100644 --- a/libxslt/attributes.c +++ b/libxslt/attributes.c @@ -644,6 +644,11 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt, xmlNodePtr node, name = comp->name; } + if (xmlValidateQName(name, 0)) { + xsltTransformError(ctxt, NULL, inst, + "xsl:attribute : invalid QName\n"); + /* we fall through to catch any further errors, if possible */ + } ncname = xmlSplitQName2(name, &prefix); if (ncname == NULL) { prefix = NULL; diff --git a/libxslt/transform.c b/libxslt/transform.c index c134337..5fba3e8 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -2533,6 +2533,11 @@ xsltElement(xsltTransformContextPtr ctxt, xmlNodePtr node, name = comp->name; } + if (xmlValidateQName(name, 0)) { + xsltTransformError(ctxt, NULL, inst, + "xsl:element : invalid name\n"); + /* we fall through to catch any other errors if possible */ + } ncname = xmlSplitQName2(name, &prefix); if (ncname == NULL) { prefix = NULL;