Changeset 68183 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jul 31, 2017 8:25:25 AM (7 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/isomaker.cpp
r68147 r68183 38 38 #include <iprt/err.h> 39 39 #include <iprt/ctype.h> 40 #include <iprt/md5.h> 40 41 #include <iprt/file.h> 41 42 #include <iprt/list.h> … … 46 47 #include <iprt/vfs.h> 47 48 #include <iprt/vfslowlevel.h> 49 #include <iprt/zero.h> 48 50 #include <iprt/formats/iso9660.h> 49 51 … … 5107 5109 } 5108 5110 5111 #if 0 /* this doesn't quite fool it. */ 5112 /* 5113 * isomd5sum fake. 5114 */ 5115 if (1) 5116 { 5117 uint8_t abDigest[RTMD5_HASH_SIZE]; 5118 if (pThis->cbSysArea == 0) 5119 RTMd5(g_abRTZero4K, ISO9660_SECTOR_SIZE, abDigest); 5120 else 5121 { 5122 RTMD5CONTEXT Ctx; 5123 RTMd5Init(&Ctx); 5124 RTMd5Update(&Ctx, pThis->pbSysArea, RT_MIN(pThis->cbSysArea, ISO9660_SECTOR_SIZE)); 5125 if (pThis->cbSysArea < ISO9660_SECTOR_SIZE) 5126 RTMd5Update(&Ctx, g_abRTZero4K, ISO9660_SECTOR_SIZE - pThis->cbSysArea); 5127 RTMd5Final(abDigest, &Ctx); 5128 } 5129 char szFakeHash[RTMD5_DIGEST_LEN + 1]; 5130 RTMd5ToString(abDigest, szFakeHash, sizeof(szFakeHash)); 5131 5132 size_t cch = RTStrPrintf((char *)&pPrimary->abAppUse[0], sizeof(pPrimary->abAppUse), 5133 "ISO MD5SUM = %s;SKIPSECTORS = %u;RHLISOSTATUS=1;THIS IS JUST A FAKE!", 5134 szFakeHash, pThis->cbFinalizedImage / RTFSISOMAKER_SECTOR_SIZE - 1); 5135 memset(&pPrimary->abAppUse[cch], ' ', sizeof(pPrimary->abAppUse) - cch); 5136 } 5137 #endif 5138 5109 5139 return VINF_SUCCESS; 5110 5140 } -
trunk/src/VBox/Runtime/generic/RTFileReadAllByHandleEx-generic.cpp
r62477 r68183 65 65 * Try allocate the required memory and initialize the header (hardcoded fun). 66 66 */ 67 void *pvHdr = RTMemAlloc(cbAllocMem + 32 );67 void *pvHdr = RTMemAlloc(cbAllocMem + 32 + (fFlags & RTFILE_RDALL_F_TRAILING_ZERO_BYTE ? 1 : 0)); 68 68 if (pvHdr) 69 69 { … … 81 81 if (RT_SUCCESS(rc)) 82 82 { 83 if (fFlags & RTFILE_RDALL_F_TRAILING_ZERO_BYTE) 84 ((uint8_t *)pvFile)[cbAllocFile] = '\0'; 85 83 86 /* 84 87 * Success - fill in the return values.
Note:
See TracChangeset
for help on using the changeset viewer.