Source: fontconfig
Version: 2.11.0-6.7
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: randomness
X-Debbugs-Cc: [email protected]

Hi,

Whilst working on the Reproducible Builds [0] we noticed that the fc-cache
command generates cache files in with non-deterministic contents.

This is problematic for us as bootstrapping a new Debian system will result
in different contents under /var/cache/fontconfig and thus the generated
system is not reproducible. In Tails[1] we are working around this by simply
deleting the contents of this directory [2] but this probably isn't a good
idea.

The cause is due to fc-cache writing unitialised memory during scanning of 
the directory index.

Patch attached.


 [0] https://reproducible-builds.org/
 [1] https://tails.boum.org/
 [2] 
https://git-tails.immerda.ch/tails/tree/config/chroot_local-hooks/99-zzzzzz_reproducible-builds-post-processing?h=feature/5630-deterministic-builds#n28


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
diff --git a/src/fcpat.c b/src/fcpat.c
index 0614ac2..374432a 100644
--- a/src/fcpat.c
+++ b/src/fcpat.c
@@ -33,6 +33,7 @@ FcPatternCreate (void)
     p = (FcPattern *) malloc (sizeof (FcPattern));
     if (!p)
        return 0;
+    memset (p, 0, sizeof (FcPattern));
     p->num = 0;
     p->size = 0;
     p->elts_offset = FcPtrToOffset (p, NULL);

Reply via email to