提交 5a2a474e 编写于 作者: A Adam Litke 提交者: Eric Blake

Allow probing of image formats without version information

Disk image formats that wish to opt-out of version validation are supposed to
set versionOffset to -1 in their fileTypeInfo entry.

By unconditionally returning False for these formats,
virStorageFileMatchesVersion() incorrectly reports a version mismatch when the
test was actually skipped.  The correct behavior is to return True so these
formats can be successfully probed using the magic bytes alone.
Signed-off-by: NAdam Litke <agl@us.ibm.com>
上级 d2af8ffc
......@@ -479,7 +479,7 @@ virStorageFileMatchesVersion(int format,
/* Validate version number info */
if (fileTypeInfo[format].versionOffset == -1)
return false;
return true;
if ((fileTypeInfo[format].versionOffset + 4) > buflen)
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册