projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab31883
)
fs/squashfs: sqfs_close/sqfs_read_sblk: set ctxt.sblk to NULL after free
author
Richard Genoud
<richard.genoud@posteo.net>
Tue, 24 Nov 2020 17:07:52 +0000
(18:07 +0100)
committer
Tom Rini
<trini@konsulko.com>
Wed, 2 Dec 2020 21:21:58 +0000
(16:21 -0500)
This will prevent a double free error if sqfs_close() is called twice.
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
fs/squashfs/sqfs.c
patch
|
blob
|
history
diff --git
a/fs/squashfs/sqfs.c
b/fs/squashfs/sqfs.c
index
608a2bb
..
5de69ac
100644
(file)
--- a/
fs/squashfs/sqfs.c
+++ b/
fs/squashfs/sqfs.c
@@
-49,6
+49,7
@@
static int sqfs_read_sblk(struct squashfs_super_block **sblk)
if (sqfs_disk_read(0, 1, *sblk) != 1) {
free(*sblk);
+ sblk = NULL;
return -EINVAL;
}
@@
-1689,9
+1690,10
@@
free_strings:
void sqfs_close(void)
{
+ sqfs_decompressor_cleanup(&ctxt);
free(ctxt.sblk);
+ ctxt.sblk = NULL;
ctxt.cur_dev = NULL;
- sqfs_decompressor_cleanup(&ctxt);
}
void sqfs_closedir(struct fs_dir_stream *dirs)