projects/guix·blob java-team · refs

20 lines · 573 B

1Fix a bug whereby 'mformat' could end up passing uninitialized bytes
2to write(2). This could be reproduced with:
3
4 mformat -C -f 1440 -L 16 -N 77777777 -i /tmp/x ::
5
6where the output of /tmp/x would be non-deterministic.
7
8Patch by Ludovic Courtès <[email protected]>.
9
10--- mtools-4.0.23/mformat.c 2019-04-21 00:12:01.496116195 +0200
11+++ mtools-4.0.23/mformat.c 2019-04-21 00:12:36.675967157 +0200
12@@ -927,6 +927,7 @@ void mformat(int argc, char **argv, int
13
14 char *endptr;
15
16+ memset(&boot.bytes, '\0', sizeof boot);
17 hs = hs_set = 0;
18 argtracks = 0;
19 argheads = 0;
20