mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
Remove realloc call which caused overflow
This commit is contained in:
parent
f2ffea858c
commit
07e38ad6e8
@ -1,3 +1,8 @@
|
|||||||
|
Wed Mar 21 11:29:06 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* qemud/buf.c: Remove redundant (and broken) call to realloc()
|
||||||
|
which caused a buffer overflow
|
||||||
|
|
||||||
Wed Mar 21 16:31:29 CET 2007 Daniel Veillard <veillard@redhat.com>
|
Wed Mar 21 16:31:29 CET 2007 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* qemud/buf.c src/xml.c: clarified virBufferGrow (and bufferGrow)
|
* qemud/buf.c src/xml.c: clarified virBufferGrow (and bufferGrow)
|
||||||
|
13
qemud/buf.c
13
qemud/buf.c
@ -118,18 +118,7 @@ bufferFree(bufferPtr buf)
|
|||||||
char *
|
char *
|
||||||
bufferContentAndFree (bufferPtr buf)
|
bufferContentAndFree (bufferPtr buf)
|
||||||
{
|
{
|
||||||
char *content;
|
char *content = buf->content;
|
||||||
|
|
||||||
content = buf->content;
|
|
||||||
|
|
||||||
/* Try to reduce the size of the block, but if it fails, it doesn't
|
|
||||||
* matter.
|
|
||||||
*/
|
|
||||||
if (buf->use < buf->size) {
|
|
||||||
char *old_content = content;
|
|
||||||
content = realloc (content, buf->use);
|
|
||||||
content = content ? content : old_content;
|
|
||||||
}
|
|
||||||
|
|
||||||
free (buf);
|
free (buf);
|
||||||
return content;
|
return content;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user