Re: [xml] xmlOutputBufferGetSize and xmlOutputBufferGetContent



Hello guys thank you for your attention. Let me share with you the code:
https://github.com/SpiderLabs/ModSecurity/blob/remotes/trunk/apache2/msc_crypt.c

Daniel, i think that would be the problem... there is something i'm missing or doing wrong between the time i change the tree and start accessing the output buffer.

In this code int the line 708 i'm changing the tree using xmlSetProp(), then starting on line 1076 i would like to get the new tree and copy it to my own variable.

Let me know if you have any more questions.

Thanks

Breno




On Thu, Jun 6, 2013 at 5:24 AM, Daniel Veillard <veillard redhat com> wrote:
On Thu, Jun 06, 2013 at 02:51:19PM +1000, Callum Gibson wrote:
> On 06Jun13 01:38, Breno Silva wrote:
> }> I changed it to (using libxml2 2.9.0):
> }>
> }> memcpy(buf, xmlOutputBufferGetContent(output_buf),
> }> xmlOutputBufferGetSize(output));
>
> Should that second one also be output_buf, not output?

  that's one thing. The other is that I dont understand what
you are doing between the time you modify the tree (which sounds
correct) and the time you start accessing output_buf which I assume
is an xmlOutputBufferPtr. An xmlOutputBuffer ought to be flushed
before collecting data for example if there is an encoding conversion
taking place from UTF-8. But that's all guessing without seeing the
actual code...

Daniel

--
Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
https://mail.gnome.org/mailman/listinfo/xml



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