From 250f2f52fa3074c66b426a20200ad6934bc071de Mon Sep 17 00:00:00 2001 From: Henrik Grindal Bakken Date: Wed, 6 Dec 2017 13:18:51 +0100 Subject: [PATCH 4/4] xattr: Initialize header to avoid valgrind warning The 'unused' field was written uninitialized to disk. This introduces a randomness into the file system, and it also ends up as a valgrind warning. Signed-off-by: Phillip Lougher --- squashfs-tools/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c index 64dfd82..b802965 100644 --- a/squashfs-tools/xattr.c +++ b/squashfs-tools/xattr.c @@ -425,7 +425,7 @@ long long write_xattrs() int i, avail_bytes; char *datap = data_cache; long long start_bytes = bytes; - struct squashfs_xattr_table header; + struct squashfs_xattr_table header = {}; if(xattr_ids == 0) return SQUASHFS_INVALID_BLK; -- 1.8.3.1