Permalink
Browse files

valgrind joy: avoid uninit data

  • Loading branch information...
1 parent b08d4ee commit 93c0614fc6192713fa549ab487dc665b968a325d Daniel Borca committed with Daniel Borca Feb 26, 2010
Showing with 7 additions and 0 deletions.
  1. +2 −0 dmg/dmglib.c
  2. +1 −0 hfs/rawfile.c
  3. +4 −0 minizip/zip.c
View
@@ -235,13 +235,15 @@ int buildDmg(AbstractFile* abstractIn, AbstractFile* abstractOut, unsigned int B
koly.fUDIFSegmentID.data4 = rand();
koly.fUDIFDataForkChecksum.type = CHECKSUM_CRC32;
koly.fUDIFDataForkChecksum.size = 0x20;
+ memset(&koly.fUDIFDataForkChecksum.data, 0, sizeof(koly.fUDIFDataForkChecksum.data));
koly.fUDIFDataForkChecksum.data[0] = dataForkChecksum;
koly.fUDIFXMLOffset = plistOffset;
koly.fUDIFXMLLength = plistSize;
memset(&(koly.reserved1), 0, 0x78);
koly.fUDIFMasterChecksum.type = CHECKSUM_CRC32;
koly.fUDIFMasterChecksum.size = 0x20;
+ memset(&koly.fUDIFMasterChecksum.data, 0, sizeof(koly.fUDIFMasterChecksum.data));
koly.fUDIFMasterChecksum.data[0] = calculateMasterChecksum(resources);
printf("Master checksum: %x\n", koly.fUDIFMasterChecksum.data[0]); fflush(stdout);
View
@@ -374,6 +374,7 @@ int writeExtents(RawFile* rawFile) {
if(extent != NULL) {
extentKey.keyLength = sizeof(HFSPlusExtentKey) - sizeof(extentKey.keyLength);
extentKey.forkType = 0;
+ extentKey.pad = 0;
extentKey.fileID = rawFile->id;
currentExtent = 0;
View
@@ -866,6 +866,10 @@ extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi,
if (err==Z_OK)
zi->ci.stream_initialised = 1;
}
+ else
+ {
+ zi->ci.stream.data_type = Z_UNKNOWN;
+ }
# ifndef NOCRYPT
zi->ci.crypt_header_size = 0;
if ((err==Z_OK) && (password != NULL))

0 comments on commit 93c0614

Please sign in to comment.