From: Daniel P. Berrange Date: Wed, 21 Mar 2007 15:32:32 +0000 (+0000) Subject: Remove realloc call which caused overflow X-Git-Tag: LIBVIRT_0_2_2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07e38ad6e81b085e043a8eb5bf04f6f80427e0fb;p=thirdparty%2Flibvirt.git Remove realloc call which caused overflow --- diff --git a/ChangeLog b/ChangeLog index a3b8df7c73..5748f95e55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 21 11:29:06 EST 2007 Daniel P. Berrange + + * 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 * qemud/buf.c src/xml.c: clarified virBufferGrow (and bufferGrow) diff --git a/qemud/buf.c b/qemud/buf.c index 2ce2462a69..b3b4866641 100644 --- a/qemud/buf.c +++ b/qemud/buf.c @@ -118,18 +118,7 @@ bufferFree(bufferPtr buf) char * bufferContentAndFree (bufferPtr buf) { - char *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; - } + char *content = buf->content; free (buf); return content;