[libxslt] Avoid an error in namespace generation



commit b1ca88f45976962504865a9c977dd625c381b237
Author: Martin <gzlist googlemail com>
Date:   Thu Sep 17 11:09:22 2009 +0200

    Avoid an error in namespace generation
    
    * libxslt/namespaces.c: fix xsltGetSpecialNamespace fallback with
      uninitialized prefix string

 libxslt/namespaces.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libxslt/namespaces.c b/libxslt/namespaces.c
index b147df8..3e3891f 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]