Re: [Libvir] Fix buffer overflow in dumping XML

2007-03-22 Thread Richard W.M. Jones
Daniel P. Berrange wrote: The new bufferContentAndFree() method used for the QEMU daemon rellocs the buffer size down to release memory held by the buffer which was never used for any data. Unfortunately it reallocs it 1 byte too small, so later uses of strlen()/strcpy() either magically work,

[Libvir] Fix buffer overflow in dumping XML

2007-03-21 Thread Daniel P. Berrange
The new bufferContentAndFree() method used for the QEMU daemon rellocs the buffer size down to release memory held by the buffer which was never used for any data. Unfortunately it reallocs it 1 byte too small, so later uses of strlen()/strcpy() either magically work, or randomly append gargage or

Re: [Libvir] Fix buffer overflow in dumping XML

2007-03-21 Thread Daniel Veillard
On Wed, Mar 21, 2007 at 03:09:09PM +, Daniel P. Berrange wrote: The new bufferContentAndFree() method used for the QEMU daemon rellocs the buffer size down to release memory held by the buffer which was never used for any data. Unfortunately it reallocs it 1 byte too small, so later uses