aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block.c b/block.c
index 2ba76b2c36..b204b93a2e 100644
--- a/block.c
+++ b/block.c
@@ -6119,6 +6119,10 @@ void bdrv_img_create(const char *filename, const char *fmt,
"same filename as the backing file");
goto out;
}
+ if (backing_file[0] == '\0') {
+ error_setg(errp, "Expected backing file name, got empty string");
+ goto out;
+ }
}
backing_fmt = qemu_opt_get(opts, BLOCK_OPT_BACKING_FMT);