Re: [xml] debugging outputbuffer code in libxml



On Mon, Mar 03, 2003 at 12:32:27PM -0500, Gennady Feldman wrote:
[clipped]
Either you or me are misunderstanding the encoder code. Can you send me
your test program, along with the XML it was parsing, or tell me what to
do to provoke libxml to write beyond the end of the buffer it
allocated?

Ciao,
Igor

Ok, here is the latest/smallest patch that I put together. I wasn't sure
what was better just pasting the new piece of code or doing a "diff -u".
The fix is a rather simple one and fixes most of the problems that I
stumbled onto. I am still tracing as to why we got that condition in
place. One of the major reasons is that the new UTF8toUTF8 encoder
function got added which triggered the condition because it returns -1
and doesn't reset the written value. What I did was just put a safety
check around the code and it runs great now.

[clipped]

P.S. I am attaching my test file source file and I am pretty sure that
you can use any XML file bigger than 4kb to test it on. Actually in some
cases any XML file will do.

[clipped]

Thanks. As far as I can see with the debugger, you are right, the thing
really writes beyond the end of the allocated buffer, within the call to
xmlAllocOutputBuffer().

However, I would rather not mess with the code so basic to libxml
without having heard Daniel's opinion. I have nothing better to do at
the moment, true enough, but this will have to wait for the end of
Daniel's looooong weekend. :-)

Ciao,
Igor




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