1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-11-05 12:10:38 +03:00

Avoid an error in namespace generation

* libxslt/namespaces.c: fix xsltGetSpecialNamespace fallback with
  uninitialized prefix string
This commit is contained in:
Martin
2009-09-17 11:09:22 +02:00
committed by Daniel Veillard
parent 4fedd0dc16
commit b1ca88f459

View File

@@ -584,6 +584,10 @@ declare_new_prefix:
xmlChar pref[30]; xmlChar pref[30];
int counter = 1; int counter = 1;
if (nsPrefix == NULL) {
nsPrefix = "ns";
}
do { do {
snprintf((char *) pref, 30, "%s_%d", nsPrefix, counter++); snprintf((char *) pref, 30, "%s_%d", nsPrefix, counter++);
ns = xmlSearchNs(target->doc, target, BAD_CAST pref); ns = xmlSearchNs(target->doc, target, BAD_CAST pref);