<div dir="ltr"><div>Ok,</div><div><br></div><div>I'm using Windows 7 64bit</div><div>Visual Studio 2010</div><div><br></div><div><span style="font-size:13px;font-family:arial,sans-serif"><b>xmlsec1-1.2.19</b> linking with ( </span>libiconv-1.9.2, <b>libxml2-2.9.1</b> and libxslt-1.1.28 ) compiled by myself.</div>
<div><br></div><div>The</div><div><div style="font-family:arial,sans-serif;font-size:13px"><b>ret = xmlOutputBufferClose(buf);</b><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
seems not clean the buffer, when using ("invalid" transform), with return (-1).</div></div><div><br></div><div>What do you recommend?</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Sep 10, 2013 at 4:08 PM, Aleksey Sanin <span dir="ltr"><<a href="mailto:aleksey@aleksey.com" target="_blank">aleksey@aleksey.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Just to follow up... I've tried to reproduce the issue with the current<br>
git versions of both XMLSec and LibXML2 but I don't see the memory<br>
leak. Looking at the code, the only possible scenario to have this leak<br>
is a missing "close" callback from LibXML2 IO system. It might be either<br>
version specific (i.e. bug in the old LibXML2) or it might be Windows<br>
specific (I run tests on Linux + valgrind). I've looked at the current<br>
LibXML2 code and I don't see any issues there. I wonder if Daniel can<br>
remember any fixes in this area in the latest releases.<br>
<br>
Best,<br>
<br>
Aleksey<br>
<div class="im"><br>
On 8/30/13 4:10 PM, Alexwell Sandro wrote:<br>
> I am using xmlsec1-1.2.19<br>
><br>
> Documents attached:<br>
><br>
</div>> *signature_enveloping_edited_invalid_transform.xml*<br>
<div class="im">> Contains Xml Signature enveloping of binary file edited.<br>
</div>> (Added Invalid Transform to binary:  *<ds:Transform<br>
> Algorithm="<a href="http://www.w3.org/2001/10/xml-exc-c14n#" target="_blank">http://www.w3.org/2001/10/xml-exc-c14n#</a>"/>* )<br>
><br>
> *log_from_stderr.txt*<br>
<div class="im">> Contains prints from XmlSec library (eg.:<br>
> func=xmlSecParserPushBin:file=..\(...) )<br>
><br>
</div>> *log_from_memory_leak_detector.txt*<br>
<div class="im">> Contains memory leak trace.<br>
><br>
><br>
><br>
> On Fri, Aug 30, 2013 at 7:06 PM, Aleksey Sanin <<a href="mailto:aleksey@aleksey.com">aleksey@aleksey.com</a><br>
</div><div><div class="h5">> <mailto:<a href="mailto:aleksey@aleksey.com">aleksey@aleksey.com</a>>> wrote:<br>
><br>
>     Any chance you can send the complete XML file that demonstrates<br>
>     the problem? Or the exact print-out from the memory leak?<br>
><br>
>     Thanks in advance,<br>
><br>
>     Aleksey<br>
><br>
>     On 8/30/13 11:30 AM, Alexwell Sandro wrote:<br>
>     > I create enveloping signature of binary file:<br>
>     ><br>
>     > ...<br>
>     > <ds:Reference Id="myId" URI="#*ObjectId*"><br>
>     > <ds:Transforms><br>
>     > <ds:Transform Algorithm="<a href="http://www.w3.org/2000/09/xmldsig#base64" target="_blank">http://www.w3.org/2000/09/xmldsig#base64</a>"/><br>
>     > </ds:Transforms><br>
>     > ...<br>
>     > <ds:Object Id="*ObjectId*">ghimBgkq</ds:Object><br>
>     > ...<br>
>     ><br>
>     > *I edited the file placing a transform (invalid to binary):*<br>
>     ><br>
>     > ...<br>
>     > <ds:Reference Id="myId" URI="#*ObjectId*"><br>
>     > <ds:Transforms><br>
>     > <ds:Transform Algorithm="<a href="http://www.w3.org/2000/09/xmldsig#base64" target="_blank">http://www.w3.org/2000/09/xmldsig#base64</a>"/><br>
>     > *<ds:Transform Algorithm="<a href="http://www.w3.org/2001/10/xml-exc-c14n#" target="_blank">http://www.w3.org/2001/10/xml-exc-c14n#</a>"/>*<br>
>     > </ds:Transforms><br>
>     > ...<br>
>     > <ds:Object Id="*ObjectId*">ghimBgkq</ds:Object><br>
>     > ...<br>
>     ><br>
>     > When verify occurs memory leak.<br>
>     ><br>
>     > Is related to (at *transforms.c* line 2807)<br>
>     > *buffer =<br>
>     ><br>
>     (xmlSecTransformIOBufferPtr)xmlMalloc(sizeof(xmlSecTransformIOBuffer));*<br>
>     ><br>
>     > (at *c14n.c* line 277).<br>
>     ><br>
>     > ...<br>
>     > *ret = xmlOutputBufferClose(buf);*<br>
>     > ...<br>
>     > ret contains the value (-1)<br>
>     ><br>
>     > Is memory leak, or some error in my build?<br>
>     ><br>
>     ><br>
>     ><br>
>     ><br>
>     ><br>
>     ><br>
>     ><br>
>     ><br>
>     ><br>
>     > _______________________________________________<br>
>     > xmlsec mailing list<br>
</div></div>>     > <a href="mailto:xmlsec@aleksey.com">xmlsec@aleksey.com</a> <mailto:<a href="mailto:xmlsec@aleksey.com">xmlsec@aleksey.com</a>><br>
>     > <a href="http://www.aleksey.com/mailman/listinfo/xmlsec" target="_blank">http://www.aleksey.com/mailman/listinfo/xmlsec</a><br>
>     ><br>
><br>
><br>
</blockquote></div><br></div>