[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 :-).
pgpOw9r05aq6O.pgp
Description: PGP signature
- [Qemu-devel] [PATCH v2 0/6] RESEND - Update filename string sizes in block layer, Jeff Cody, 2015/01/20
- [Qemu-devel] [PATCH v2 2/6] block: vmdk - move string allocations from stack to the heap, Jeff Cody, 2015/01/20
- [Qemu-devel] [PATCH v2 3/6] block: qapi - move string allocation from stack to the heap, Jeff Cody, 2015/01/20
- [Qemu-devel] [PATCH v2 4/6] block: move string allocation from stack to the heap, Jeff Cody, 2015/01/20
- [Qemu-devel] [PATCH v2 5/6] block: mirror - change string allocation to 2-bytes, Jeff Cody, 2015/01/20
- [Qemu-devel] [PATCH v2 1/6] block: vmdk - make ret variable usage clear, Jeff Cody, 2015/01/20
- [Qemu-devel] [PATCH v2 6/6] block: update string sizes for filename, backing_file, exact_filename, Jeff Cody, 2015/01/20