Hi list,
I'm not filing a bug because it's a small fix, but there's a problem
with xmlSetNsProp which doesn't check whether the node we're trying to
put a property on is an element node or not. See the attached patch.
In case of a malformed XSLT, it can lead to a segfault, see debian bug
#293592 [1] for more details. (basically, using xmlSetNsProp on an empty
document tree puts it in the doc, and it also become an intSubset, being
why there's a segfault in xmlFreeDtd ; by the way, shouldn't there be
some more checks in xmlFree* stuff to avoid such cases ?)
Mike
1. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293592
Index: tree.c
===================================================================
--- tree.c (リビジョン 349)
+++ tree.c (作業コピー)
@@ -6438,7 +6438,7 @@
const xmlChar *value) {
xmlAttrPtr prop;
- if ((node == NULL) || (name == NULL))
+ if ((node == NULL) || (name == NULL) || (node->type != XML_ELEMENT_NODE))
return(NULL);
if (ns == NULL)_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml