mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
block: Fix bdrv_open use after free
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 <kwolf@redhat.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user