From f76974ba96404f5243fbe7dbd8e6c8ea9003c37e Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Thu, 29 Jan 2004 22:08:52 +0000 Subject: [PATCH] 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) --- ChangeLog | 6 ++++++ libxslt/attributes.c | 5 +++++ libxslt/transform.c | 5 +++++ 3 files changed, 16 insertions(+) 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; -- 2.7.4