[PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent

Heinrich Schuchardt xypron.glpk at gmx.de
Mon May 17 08:21:39 CEST 2021


When reading directories the UEFI sub-system must supply file attributes
and timestamps. These fields will have to be added to struct fs_dirent.
SquashFS should not fill these fields with random data. Ensure that they
are zeroed out.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 fs/squashfs/sqfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 29805c3c6f..997be2dcf4 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -876,7 +876,7 @@ int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
 	char **token_list = NULL, *path = NULL;
 	u32 *pos_list = NULL;

-	dirs = malloc(sizeof(*dirs));
+	dirs = calloc(1, sizeof(*dirs));
 	if (!dirs)
 		return -EINVAL;

--
2.30.2



More information about the U-Boot mailing list