projects
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da7991b
)
fs/squashfs: NULL dereference in sqfs_closedir()
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Mon, 1 Feb 2021 02:28:48 +0000
(
03:28
+0100)
committer
Tom Rini
<trini@konsulko.com>
Wed, 24 Feb 2021 21:51:48 +0000
(16:51 -0500)
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>
fs/squashfs/sqfs.c
patch
|
blob
|
history
diff --git
a/fs/squashfs/sqfs.c
b/fs/squashfs/sqfs.c
index dca13bd1f1d260d873e15640d710d33cdde71e93..29805c3c6f32904270d878b6d44cfac8c97afd63 100644
(file)
--- a/
fs/squashfs/sqfs.c
+++ b/
fs/squashfs/sqfs.c
@@
-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);