aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-05-22 08:17:55 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-22 10:50:29 -0500
commitc833ab7351f2ebac46740380a81e34482e208dcc (patch)
tree95676477087a9ce697fe01e349ccfbd6aad26888 /block.c
parent71b9b0ca5b29899042c5170692c468093fdb8af6 (diff)
downloadqemu-c833ab7351f2ebac46740380a81e34482e208dcc.zip
qemu-c833ab7351f2ebac46740380a81e34482e208dcc.tar.gz
qemu-c833ab7351f2ebac46740380a81e34482e208dcc.tar.bz2
Fix segv when passing an unknown protocol
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block.c b/block.c
index 980fbec..cbc83b1 100644
--- a/block.c
+++ b/block.c
@@ -306,7 +306,7 @@ static BlockDriver *find_image_format(const char *filename)
drv = find_protocol(filename);
/* no need to test disk image formats for vvfat */
- if (strcmp(drv->format_name, "vvfat") == 0)
+ if (drv && strcmp(drv->format_name, "vvfat") == 0)
return drv;
ret = bdrv_file_open(&bs, filename, BDRV_O_RDONLY);