[vbox-dev] small bug on VDGetFormat()

Huihong Luo huisinro at yahoo.com
Fri May 27 15:45:42 GMT 2011


when file size is zero, it returns vmdk format by mistake.
 
vd.cpp:
 
VBOXDDU_DECL(int) VDGetFormat(PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
const char *pszFilename, char **ppszFormat, VDTYPE *penmType)
{
 
if ( RT_SUCCESS(rc)
/* The correct backend has been found, but there is a small
* incompatibility so that the file cannot be used. Stop here
* and signal success - the actual open will of course fail,
* but that will create a really sensible error message. */
|| ( rc != VERR_VD_GEN_INVALID_HEADER
&& rc != VERR_VD_VDI_INVALID_HEADER
&& rc != VERR_VD_VMDK_INVALID_HEADER
&& rc != VERR_VD_ISCSI_INVALID_HEADER
&& rc != VERR_VD_VHD_INVALID_HEADER
&& rc != VERR_VD_RAW_INVALID_HEADER
&& rc != VERR_VD_PARALLELS_INVALID_HEADER
&& rc != VERR_VD_DMG_INVALID_HEADER
&& rc != VERR_EOF))  <=== add this condition
 
}
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20110527/66cd518e/attachment.html>


More information about the vbox-dev mailing list