squashfs-tools/0004-xattr-Initialize-header-to-avoid-valgrind-warning.patch
Zhiqiang Liu 6f65f8ac04 squashfs-tools: backport upstream bugfix patches
squashfs-tools: backport upstream bugfix patches

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-07-13 11:46:25 +08:00

31 lines
946 B
Diff

From 250f2f52fa3074c66b426a20200ad6934bc071de Mon Sep 17 00:00:00 2001
From: Henrik Grindal Bakken <henribak@cisco.com>
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 <phillip@squashfs.org.uk>
---
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