[xml] problem: xml-data w/ large content and xmlParseDoc



I'm using libxml (2.4.21) on Win32. I encountered a problem while passing xml Data with a tag containing 
quite a lot of base64-encoded data in memory.

I have a document that looks similiar to this in a char *:
<DOC>
<Subtag>
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM
(last line repeated about 200 times)
</Subtag>
</DOC>

When I try to parse it using either xmlParseDoc or xmlParseMemory, I always get these error messages:

Entity: line 69: error: Premature end of data in tag <LData DataLength="23563">MDAw
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMz
                                                                     ^
Entity: line 69: error: Premature end of data in tag MzMzMzMzMzMzMzMzMzMzMzMzMzMzMz
zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMz
                                                                     ^

If i write the data to a file and use xmlParseFile instead, it works.

I had a look into the code already and I think the problem is somewhere in SHRINK / GROW as used in 
xmlParseCharData.

After initializing the special handling for Large Content in line 2640 of parser.c (sources to 2.4.21), 
SHRINK / GROW is called, but afterwards ctxt->input->cur points to a 0 before the start of the real document 
data in memory.

Regards,
Matthias Helletzgruber




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