Re: [xml] xmlTextReaderClose causing segfault

On Sun, Apr 18, 2004 at 05:54:04AM -0400, Rob Richards wrote:
From: "Daniel Veillard" <veillard redhat com>
  yes, that's a bug. xmlTextReaderClose() should set up
reader->ctxt to NULL after calling xmlFreeParserCtxt(), definitely.
I fixed my CVs checkount, I will commit this later.
Now the ways to turn around the problem is to allocate the context
yourself and use xmlReaderNewxxx instead of xmlReaderForxxx
that way libxml2 should not free the parser contect on Close,
but you will have to do it, that should work.

Unfortunately I cant use those functions yet as it needs to run under libxml
2.5.10+, so just going to skip using xmlTextReaderClose() for now until
2.6.x becomes the base version.
Also, you might also want to add that to the same block of code in
xmlTextReaderGetRemainder() as it has the same issue.

 After some thinking, the proper fix is to only free the parser context
when freeing the reader. I made the changes and will commit it in CVS,


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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