libdmg.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From d1a5eca891f32103ccda80ee75e158dfc7ece70d Mon Sep 17 00:00:00 2001
  2. From: Mike Perry <mikeperry-git@torproject.org>
  3. Date: Thu, 6 Mar 2014 19:47:05 -0800
  4. Subject: [PATCH] Memset a UDIF header to ensure archive reproducibility.
  5. Some of the struct padding and fields contained unitialized memory, which
  6. caused two successive invocations to produce archives that differed in some
  7. bytes.
  8. ---
  9. dmg/dmglib.c | 6 ++++--
  10. 1 file changed, 4 insertions(+), 2 deletions(-)
  11. diff --git a/dmg/dmglib.c b/dmg/dmglib.c
  12. index f481b1f..b74e50b 100644
  13. --- a/dmg/dmglib.c
  14. +++ b/dmg/dmglib.c
  15. @@ -108,7 +108,8 @@ int buildDmg(AbstractFile* abstractIn, AbstractFile* abstractOut) {
  16. ChecksumToken dataForkToken;
  17. UDIFResourceFile koly;
  18. -
  19. + memset(&koly, 0, sizeof(koly));
  20. +
  21. off_t plistOffset;
  22. uint32_t plistSize;
  23. uint32_t dataForkChecksum;
  24. @@ -284,7 +285,8 @@ int convertToDMG(AbstractFile* abstractIn, AbstractFile* abstractOut) {
  25. uint64_t numSectors;
  26. UDIFResourceFile koly;
  27. -
  28. + memset(&koly, 0, sizeof(koly));
  29. +
  30. char partitionName[512];
  31. off_t fileLength;
  32. --
  33. 1.8.1.2