[xmlsec] Re: [xml] error in moving nodes between documents: heap corruption detected

Tomas Sieger tomas.sieger at systinet.com
Tue Nov 30 04:42:40 PST 2004


Thanks for the quick answer!

Daniel Veillard wrote:
> On Tue, Nov 30, 2004 at 12:10:33PM +0100, Tomas Sieger wrote:
>>The problem appears in libxml2-2.6.15 and newer. libxml2-2.6.14
>>does not cause the problem. I've discovered that this commit:
>>
>>  http://cvs.gnome.org/viewcvs/libxml2/parser.c?r1=1.391&r2=1.392
> 
>   This enforces than nodes from a document always use names from
> the document dictionnary. If you want to avoid that, pass the 
> XML_PARSE_NODICT option to xmlRead... parsing functions.

Is it also possible to specify such a flag when parsing using

   ctx=xmlCreatePushParserCtxt(...);
   xmlParseChunk(...);
   doc=ctx->myDoc;
   xmlFreeParserCtxt(ctx);
?

Or, alternatively, can one "unlink" ALL references into the original 
document when moving a node into another document?

>   It is not a bug, it is a property of the documents. You can disable it
> but you will loose on performances and memory consumption.

But, unfortunately, IMHO, the parser API semantics has changed.
It implies that xmlsec (up to version 1.2.6) does not work with libxml2 
versions 2.6.15 and higher (I assume that xmlsec code: 
xmlSecParseMemoryExt and xmlSecReplaceNodeBuffer is valid in respect to 
the libxml2 reader/parser API).

Tomas



More information about the xmlsec mailing list