提交 c833ab73 编写于 作者: A Anthony Liguori

Fix segv when passing an unknown protocol

Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 71b9b0ca
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册