summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin <gzlist@googlemail.com>2009-09-17 11:09:22 +0200
committerDaniel Veillard <veillard@redhat.com>2009-09-17 11:09:22 +0200
commitb1ca88f45976962504865a9c977dd625c381b237 (patch)
tree358afed6268928380d95b3ef3ae80fc4f32846d7
parent4fedd0dc16bfa394e7dd0b2a44e21256ce3b4021 (diff)
downloadlibxslt-b1ca88f45976962504865a9c977dd625c381b237.tar.gz
Avoid an error in namespace generation
* libxslt/namespaces.c: fix xsltGetSpecialNamespace fallback with uninitialized prefix string
-rw-r--r--libxslt/namespaces.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libxslt/namespaces.c b/libxslt/namespaces.c
index b147df8f..3e3891fb 100644
--- a/libxslt/namespaces.c
+++ b/libxslt/namespaces.c
@@ -584,6 +584,10 @@ declare_new_prefix:
xmlChar pref[30];
int counter = 1;
+ if (nsPrefix == NULL) {
+ nsPrefix = "ns";
+ }
+
do {
snprintf((char *) pref, 30, "%s_%d", nsPrefix, counter++);
ns = xmlSearchNs(target->doc, target, BAD_CAST pref);