From 22628476aa8e344e1b62019b1a1862e5fc47804b Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Thu, 6 Mar 2014 19:47:05 -0800 Subject: [PATCH] Memset a UDIF header to ensure archive reproducibility. Some of the struct padding and fields contained unitialized memory, which caused two successive invocations to produce archives that differed in some bytes. --- dmg/dmglib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dmg/dmglib.c b/dmg/dmglib.c index a0532beb..6d28eaf4 100644 --- a/dmg/dmglib.c +++ b/dmg/dmglib.c @@ -107,8 +107,8 @@ int buildDmg(AbstractFile* abstractIn, AbstractFile* abstractOut, unsigned int B ChecksumToken dataForkToken; - UDIFResourceFile koly; - + UDIFResourceFile koly = {0}; + off_t plistOffset; uint32_t plistSize; uint32_t dataForkChecksum; @@ -294,8 +294,8 @@ int convertToDMG(AbstractFile* abstractIn, AbstractFile* abstractOut) { uint32_t dataForkChecksum; uint64_t numSectors; - UDIFResourceFile koly; - + UDIFResourceFile koly = {0}; + char partitionName[512]; off_t fileLength;