[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/7] block: Fix bdrv_open use after free
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 2/7] block: Fix bdrv_open use after free |
Date: |
Wed, 26 Oct 2011 14:31:17 +0200 |
tmp_filename was used outside the block it was defined in, i.e. after it went
out of scope. Move its declaration to the top level.
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block.c b/block.c
index 86d450c..9dbb572 100644
--- a/block.c
+++ b/block.c
@@ -571,6 +571,7 @@ int bdrv_open(BlockDriverState *bs, const char *filename,
int flags,
BlockDriver *drv)
{
int ret;
+ char tmp_filename[PATH_MAX];
if (flags & BDRV_O_SNAPSHOT) {
BlockDriverState *bs1;
@@ -578,7 +579,6 @@ int bdrv_open(BlockDriverState *bs, const char *filename,
int flags,
int is_protocol = 0;
BlockDriver *bdrv_qcow2;
QEMUOptionParameter *options;
- char tmp_filename[PATH_MAX];
char backing_filename[PATH_MAX];
/* if snapshot, we create a temporary backing file and open it
--
1.7.6.4
- [Qemu-devel] [PATCH 0/7] block: Collection of unrelated simple fixes, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 1/7] block: Remove dead code, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 2/7] block: Fix bdrv_open use after free,
Kevin Wolf <=
- [Qemu-devel] [PATCH 4/7] ide: Fix off-by-one error in array index check, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 5/7] vmdk: Fix use of uninitialised value, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 6/7] vmdk: Improve error handling, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 7/7] vmdk: Fix possible segfaults, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 3/7] qcow: Fix bdrv_write_compressed error handling, Kevin Wolf, 2011/10/26