fs/squashfs: NULL dereference in sqfs_closedir()
PATCH 1/1 fs/squashfs: NULL dereference in sqfs_closedir()
sqfs_opendir() called in sqfs_size(), sqfs_read(), sqfs_exists() may fail leading to sqfs_closedir(NULL) being called. Do not dereference NULL.
Signed-off-by Heinrich Schuchardt <[email protected]>
--- fs/squashfs/sqfs.c | 3 +++ 1 file changed, 3 insertions(+)
fs/squashfs/sqfs.c +3 -0
@@ -1716,6 +1716,9 @@ void sqfs_closedir(struct fs_dir_stream *dirs) {struct squashfs_dir_stream *sqfs_dirs; +if (!dirs) +return ; + sqfs_dirs = (struct squashfs_dir_stream *)dirs;free (sqfs_dirs->inode_table);free (sqfs_dirs->dir_table);
--
2.29.2
PATCH 1/1 fs/squashfs: NULL dereference in sqfs_closedir()
Quoted 4 lines · Heinrich Schuchardt
sqfs_opendir()called insqfs_size(),sqfs_read(),sqfs_exists()may fail leading tosqfs_closedir(NULL)being called. Do not dereference NULL.Signed-off-by Heinrich Schuchardt <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210225/e53fae60/attachment.sig>