[libxslt] QName parsing fix for patterns
- From: Daniel Veillard <veillard src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libxslt] QName parsing fix for patterns
- Date: Thu, 17 Sep 2009 08:00:45 +0000 (UTC)
commit a3a1d4891c0e28bb1a43582b2aef4a637fe97cfc
Author: Martin <gzlist googlemail com>
Date: Thu Sep 17 09:59:42 2009 +0200
QName parsing fix for patterns
* libxslt/pattern.c: fix a corner case and avoid a memory leak on
error
libxslt/pattern.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libxslt/pattern.c b/libxslt/pattern.c
index 815013b..c435367 100644
--- a/libxslt/pattern.c
+++ b/libxslt/pattern.c
@@ -1420,7 +1420,7 @@ xsltScanQName(xsltParserContextPtr ctxt, xmlChar **prefix) {
*prefix = NULL;
ret = xsltScanNCName(ctxt);
- if (CUR == ':') {
+ if (ret && CUR == ':') {
*prefix = ret;
NEXT;
ret = xsltScanNCName(ctxt);
@@ -1669,6 +1669,7 @@ xsltCompileStepPattern(xsltParserContextPtr ctxt, xmlChar *token, int novar) {
xsltTransformError(NULL, NULL, NULL,
"xsltCompileStepPattern : no namespace bound to prefix %s\n",
prefix);
+ xmlFree(prefix);
ctxt->error = 1;
goto error;
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]