mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-14 11:53:03 +00:00
vvfat: Fix segfault on write to read-only disk
vvfat tries to set the readonly flag in its open function, but nowadays this is overwritted with the readonly=... command line option. Check in bdrv_write if the vvfat was opened read-only and return an error in this case. Without this check, vvfat tries to access the qcow bs, which is NULL without enabled write support. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
This commit is contained in:
parent
a287916c71
commit
ac48e389d0
@ -2665,6 +2665,11 @@ static int vvfat_write(BlockDriverState *bs, int64_t sector_num,
|
|||||||
|
|
||||||
DLOG(checkpoint());
|
DLOG(checkpoint());
|
||||||
|
|
||||||
|
/* Check if we're operating in read-only mode */
|
||||||
|
if (s->qcow == NULL) {
|
||||||
|
return -EACCES;
|
||||||
|
}
|
||||||
|
|
||||||
vvfat_close_current_file(s);
|
vvfat_close_current_file(s);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user