Re: [xslt] Apparent bug in libxslt



On Thu, May 14, 2009 at 03:49:44PM -0500, Daniel Benson wrote:
> Hi all,
> 
> I was running some unit tests through Valgrind today and ran across what
> appears to be a (small) bug in libxslt.
> 
> It occurs in libxslt/transform.c on line 922 and 930
> 
> http://svn.gnome.org/viewvc/libxslt/trunk/libxslt/transform.c?view=markup
> 
> Line 922 (potentially) frees the memory pointed to by copy, line 930
> dereferences the pointer. It looks to me like the easiest solution is to
> change line 922 to
> 
> copy = xmlAddChild(target, copy);
> 
> Does this seem like the correct fix? Is there an appropriate place to send a
> patch?

  This is nearly a correct fix :-)
this list is teh right place even if I'm not always responsive :-\

> Hopefully, this is the correct address for this type of issue. Thanks for
> any help,

  Yup, I fixed this in a slightly different way, making an xsltAddChild()
wrapper and replacing all calls to xmlAddChild to 
    c = xsltAddChild(p , c);

this should take care of this issue and other potential problems.

 thanks for raising this, this kind of corner case are not trivial to
observe and debug :-)

   should be fixed in git head now,

Daniel


-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


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