Changeset 62794 in vbox for trunk/src/VBox
- Timestamp:
- Aug 1, 2016 8:09:40 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VHD.cpp
r62754 r62794 305 305 { 306 306 int rc = VINF_SUCCESS; 307 uint32_t cb, cbMaxLen = RT_BE2H_U32(pLocator->u32DataSpace); /* ugly. initialized variable on separate lines, please. */ 307 uint32_t cb = 0; 308 uint32_t cbMaxLen = RT_BE2H_U32(pLocator->u32DataSpace); 308 309 void *pvBuf = RTMemTmpAllocZ(cbMaxLen); 309 310 char *pszTmp; … … 333 334 memcpy(pvBuf, szPath, cb); 334 335 } 335 else336 cb = 0; /* (Shut up MSC) */337 336 } 338 337 else … … 355 354 rc = RTPathAbs(pszFilename, (char *)pvBuf, cbMaxLen); 356 355 if (RT_SUCCESS(rc)) 357 pLocator->u32DataLength = RT_H2BE_U32((uint32_t)strlen((const char *)pvBuf)); 356 { 357 cb = (uint32_t)strlen((const char *)pvBuf); 358 pLocator->u32DataLength = RT_H2BE_U32(cb); 359 } 358 360 break; 359 361 case VHD_PLATFORM_CODE_W2RU: … … 401 403 402 404 if (RT_SUCCESS(rc)) 405 { 406 Assert(cb > 0); 403 407 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pImage->pStorage, 404 408 RT_BE2H_U64(pLocator->u64DataOffset), 405 pvBuf, cb); /** @todo r=msc: 'cb' _IS_ used uninitialized in the VHD_PLATFORM_CODE_WI2K path! */ 409 pvBuf, cb); 410 } 406 411 407 412 if (pvBuf)
Note:
See TracChangeset
for help on using the changeset viewer.