[XML] Bug in Node Dump logic

----- Forwarded message from Christian Glahn <christian glahn lo-f at> -----

Date: Thu, 27 Feb 2003 23:12:48 +0100
From: Christian Glahn <christian glahn lo-f at>
To: xml gnome org
Cc: veillard redhat com
Subject: [XML] Bug in Node Dump logic
Mail-Followup-To: Christian Glahn <christian glahn lo-f at>, xml gnome org,
        veillard redhat com
User-Agent: Mutt/1.4i

Hi all,
hallo Daniel,

it took me a while to catch up with the recent development of libxml2.

while updating the perl interfaces to play with the new versions i realized a
bug(?) in xmlNodeDumpOutputInternal(). i am not shure, if i am wrong, but i 
think a tiny piece of code is missing in this function. 

the problem i found  occours if a single attribute node is passed to 
xmlNodeDump(). libxml2 just segfaults in this case, which is not too nice ;)
maybe it is not intended to dump attribute nodes that way, but i think the
patch does not hurt too much:

*** tree.c      
--- tree.c.patched      
*** 6932,6937 ****
--- 6932,6941 ----
          xmlDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
+     if (cur->type == XML_ATTRIBUTE_NODE) {
+       xmlAttrDumpOutput(buf,doc,cur,encoding);
+       return;
+     }
      if (cur->type == XML_TEXT_NODE) {
        if (cur->content != NULL) {
            if ((cur->name == xmlStringText) ||


----- End forwarded message -----

Mag. Christian Glahn
Research Studios Austria - Studio eLearning Environments
Austrian Research Centers (ARCS)

T ++43/(0)664 - 825 10 14


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