From: Heinrich Schuchardt Date: Mon, 17 May 2021 06:21:39 +0000 (+0200) Subject: fs/squashfs: zero out unused fields in fs_dirent X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=53ba2c21c2df142b37bb2f0d6850d79dcfd8976f;p=u-boot.git fs/squashfs: zero out unused fields in fs_dirent 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 Reviewed-by: Miquel Raynal --- 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;