Changeset 34581 in vbox
- Timestamp:
- Dec 1, 2010 4:43:39 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68376
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VMDK.cpp
r34014 r34581 3330 3330 goto out; 3331 3331 3332 /* If the descriptor file is shorter than 50 bytes it can't be valid. */ 3333 if (cbFileSize < 50) 3334 { 3335 rc = vmdkError(pImage, VERR_VD_VMDK_INVALID_HEADER, RT_SRC_POS, N_("VMDK: descriptor in '%s' is too short"), pImage->pszFilename); 3336 goto out; 3337 } 3338 3332 3339 uint64_t cbSize = cbFileSize; 3333 3340 if (cbSize % VMDK_SECTOR2BYTE(10)) … … 3344 3351 } 3345 3352 3353 /* Don't reread the place where the magic would live in a sparse 3354 * image if it's a descriptor based one. */ 3355 memcpy(pImage->pDescData, &u32Magic, sizeof(u32Magic)); 3346 3356 size_t cbRead; 3347 rc = vmdkFileReadSync(pImage, pImage->pFile, 0, pImage->pDescData, 3348 RT_MIN(pImage->cbDescAlloc, cbFileSize), 3357 rc = vmdkFileReadSync(pImage, pImage->pFile, sizeof(u32Magic), 3358 pImage->pDescData + sizeof(u32Magic), 3359 RT_MIN(pImage->cbDescAlloc - sizeof(u32Magic), 3360 cbFileSize - sizeof(u32Magic)), 3349 3361 &cbRead); 3350 3362 if (RT_FAILURE(rc)) … … 3353 3365 goto out; 3354 3366 } 3367 cbRead += sizeof(u32Magic); 3355 3368 if (cbRead == pImage->cbDescAlloc) 3356 3369 {
Note:
See TracChangeset
for help on using the changeset viewer.