mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-29 14:41:26 +01:00
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 <xypron.glpk@gmx.de>
This commit is contained in:
parent
da7991b38e
commit
220fa478fb
@ -1716,6 +1716,9 @@ void sqfs_closedir(struct fs_dir_stream *dirs)
|
|||||||
{
|
{
|
||||||
struct squashfs_dir_stream *sqfs_dirs;
|
struct squashfs_dir_stream *sqfs_dirs;
|
||||||
|
|
||||||
|
if (!dirs)
|
||||||
|
return;
|
||||||
|
|
||||||
sqfs_dirs = (struct squashfs_dir_stream *)dirs;
|
sqfs_dirs = (struct squashfs_dir_stream *)dirs;
|
||||||
free(sqfs_dirs->inode_table);
|
free(sqfs_dirs->inode_table);
|
||||||
free(sqfs_dirs->dir_table);
|
free(sqfs_dirs->dir_table);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user