From: Bernhard M. Wiedemann Date: Tue, 24 Jul 2018 07:34:21 +0000 (+0200) Subject: makeguids: initialize memory X-Git-Tag: android-x86-8.1-r1~21 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=50d7b979d1aa1c4afbb60a702bd16f9ff3066c50;p=android-x86%2Fexternal-efivar.git makeguids: initialize memory so that we do not write uninitialized memory into guids.bin and names.bin which made the resulting libefivar.so.1.36 unreproducible. See https://reproducible-builds.org/ for why this matters. --- diff --git a/src/makeguids.c b/src/makeguids.c index f84fbb8..a15356b 100644 --- a/src/makeguids.c +++ b/src/makeguids.c @@ -147,6 +147,7 @@ main(int argc, char *argv[]) outbuf = realloc(outbuf, line * sizeof (struct guidname)); if (!outbuf) err(1, "makeguids"); + memset(outbuf + line - 1, 0, sizeof(struct guidname)); char *symbol = strchr(guidstr, '\t'); if (symbol == NULL)