提交 07e38ad6 编写于 作者: D Daniel P. Berrange

Remove realloc call which caused overflow

上级 f2ffea85
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>
* qemud/buf.c src/xml.c: clarified virBufferGrow (and bufferGrow)
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册