From b1ca88f45976962504865a9c977dd625c381b237 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 17 Sep 2009 11:09:22 +0200 Subject: [PATCH] Avoid an error in namespace generation * libxslt/namespaces.c: fix xsltGetSpecialNamespace fallback with uninitialized prefix string --- libxslt/namespaces.c | 4 ++++ 1 file changed, 4 insertions(+) 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);