qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 4/6] block: move string allocation from stack


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 4/6] block: move string allocation from stack to the heap
Date: Thu, 22 Jan 2015 11:37:54 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Jan 20, 2015 at 12:31:31PM -0500, Jeff Cody wrote:
> Rather than allocate PATH_MAX bytes on the stack, use g_strndup() to
> dynamically allocate the string, and add an exit label for cleanup.
> 
> Signed-off-by: Jeff Cody <address@hidden>
> ---
>  block.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Zombie alert!

This is a funny:

Since September 2012 in commit 0bce597d6ec34b2af802799eb53ebc863c704d05
("block: convert bdrv_commit() to use bdrv_reopen()") the filename
variable has not been used.

We continued to maintain this variable faithfully, for example, to fix a
buffer overflow in commit c2cba3d9314f972dfaf724d0ec2d018eb54c95f1
("block: avoid buffer overrun by using pstrcpy, not strncpy").

Please kill the zombie filename variable instead of switching to heap
allocation :-).

Attachment: pgpOw9r05aq6O.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]