Closed GoogleCodeExporter closed 9 years ago
Original comment by arseny.k...@gmail.com
on 10 Aug 2014 at 9:51
I applied the part of this patch that deals with DOM modification.
Things that still need to happen (for future reference when I get a bit more
time):
1. Exceptions caused during parsing can lead to:
A. allocator state being discarded => pages leaked ("update allocator state"
comment) - addressed by the patch
B. document buffer not tracked in the document => buffer leaked ("grab onto
buffer" comment)
2. Exceptions caused during buffer allocation can lead to:
A. file being left open ("fclose") - addressed by the patch
B. original document buffer not deleted if encoding conversion is performed
("delete original buffer" comment)
3. Exceptions inside parser or buffer allocation in append_buffer can lead to:
A. extra buffer element and/or the buffer data leaking ("add extra buffer to
the list" comment)
I *think* that's it but I'll need to do another pass over the code to make sure.
Original comment by arseny.k...@gmail.com
on 11 Aug 2014 at 12:22
I attach an updated patch that fixes the rest of the places you mentioned. Note
that it is untested.
Also it appears to be possible to simplify further. Specifically, the
`own_buffer` can itself be a part of the `extra` list, which would cost one
paged allocation. Don't even know why it was a part of `xml_document` before.
Historical reasons?
Original comment by ybungalo...@gmail.com
on 11 Aug 2014 at 9:03
Attachments:
This issue was moved to GitHub: https://github.com/zeux/pugixml/issues/17
Original comment by arseny.k...@gmail.com
on 26 Oct 2014 at 9:09
Original issue reported on code.google.com by
ybungalo...@gmail.com
on 27 Feb 2014 at 1:44Attachments: