From c833ab7351f2ebac46740380a81e34482e208dcc Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 22 May 2009 08:17:55 -0500 Subject: [PATCH] Fix segv when passing an unknown protocol Signed-off-by: Anthony Liguori --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 980fbecf3d..cbc83b166e 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); -- GitLab