for the fUDIFDataForkChecksum.data and fUDIFMasterChecksum.data structures, it
appears as though only the first int is ever used for checksumming, but the
other bytes are still written to the image. Initialize them so they don't
contain random garbage.
This commit is contained in:
Cory Fields 2014-05-08 13:55:39 -04:00
Родитель d4a253cae4
Коммит fb0da70538
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -124,6 +124,8 @@ int buildDmg(AbstractFile* abstractIn, AbstractFile* abstractOut) {
nsiz = NULL;
memset(&dataForkToken, 0, sizeof(ChecksumToken));
memset(koly.fUDIFMasterChecksum.data, 0, sizeof(koly.fUDIFMasterChecksum.data));
memset(koly.fUDIFDataForkChecksum.data, 0, sizeof(koly.fUDIFDataForkChecksum.data));
printf("Creating and writing DDM and partition map...\n"); fflush(stdout);
@ -296,6 +298,8 @@ int convertToDMG(AbstractFile* abstractIn, AbstractFile* abstractOut) {
nsiz = NULL;
myNSiz = NULL;
memset(&dataForkToken, 0, sizeof(ChecksumToken));
memset(koly.fUDIFMasterChecksum.data, 0, sizeof(koly.fUDIFMasterChecksum.data));
memset(koly.fUDIFDataForkChecksum.data, 0, sizeof(koly.fUDIFDataForkChecksum.data));
partitions = (Partition*) malloc(SECTOR_SIZE);