Re: [xml] modifying tree and attributes



On Thu, Oct 27, 2005 at 07:14:23AM -0400, Rob Richards wrote:
Daniel Veillard wrote:


I would say the library should be made as resilient as possible.


I'm just a little puzzled so wanted to get some clarification. Getting a 
patch together  - so far it stands as (and yes all applicable tests pass 
for both libs) : http://www.ctindustries.net/libxml/tree.c.diff.txt

  Looks fine to me, the problem is that the regression tests don't
exercise the tree API as much than other parts (the python bindings
tests do to some limited extend). I think you're more likely to find
regression there by running the PHP or XML::Libxml regression tests.

Did a search on xmlAddChild to find out why it doesnt perform unlink and 
came across:
http://mail.gnome.org/archives/xml/2003-February/msg00009.html

Now, like the changes in my patch, of course the behavior will change 
(prevent tree corruption and some memleaks) which is what adding unlink 
would do in addchild.

  Maybe addchild should be fixed too. We have hopefully reasonably complete
reconciliate routines for people doing cut and past of tree fragments between
document and locations, being more resilient and pointing users with potential
trouble to that routine sounds the right approach at this point.

My confusion comes back to the resilient vs. caller responsibility issue.

  Yeah, but the bindings shifted my concerns a bit, at the time breaking
a bit the behaviour of a custom application was what I really feared. Now
what I would really fear is a segfault leading to an exploit in PHP or 
other web based front-end bindings.

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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