Bug#900409: mtools: please make the output reproducible (uninitialised memory)

Chris Lamb lamby at debian.org
Wed May 30 11:47:47 BST 2018


Source: mtools
Version: 4.0.18-2
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that mtools generates non-determinstic output.

This is due to it writing uninitialised memory in the extension part
of DOS-style "8.3" filenames.

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/direntry.c b/direntry.c
index c1d2ddd..284d0ae 100644
--- a/direntry.c
+++ b/direntry.c
@@ -24,6 +24,7 @@
 
 void initializeDirentry(direntry_t *entry, Stream_t *Dir)
 {
+	memset(entry, 0, sizeof(direntry_t));
 	entry->entry = -1;
 /*	entry->parent = getDirentry(Dir);*/
 	entry->Dir = Dir;


More information about the Reproducible-bugs mailing list