Re: [xml] Patch for xmlAddChild

On Wed, Dec 31, 2008 at 05:20:57PM -0500, Rob Richards wrote:
Kris Breuker wrote:

The xmlAddChild documentation says: "If there is an attribute with  
equal name, it is first destroyed."
However, when the attribute which is replaced is the only attribute,  
libxml crashes. I believe this is because the code assumes there are  
attributes left after the original attribute is destroyed: it reads  
parent->properties to find the last attribute in the list, but  
parent->properties is set to NULL when the only property is destroyed  
by xmlUnlinkNode.
I think the attached patch should fix this. Could someone take a look  
at it?

  Ohh, good catch !

I have applied this fix.

  Thanks !


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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