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:
dc3312c
)
fs/squashfs: sqfs_size: fix dangling pointer dirs->entry
author
Richard Genoud
<richard.genoud@posteo.net>
Tue, 3 Nov 2020 11:11:09 +0000
(12:11 +0100)
committer
Tom Rini
<trini@konsulko.com>
Thu, 19 Nov 2020 14:45:49 +0000
(09:45 -0500)
dirs->entry shouldn't be left dangling as it could be freed 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
7da2e09
..
3b008b5
100644
(file)
--- a/
fs/squashfs/sqfs.c
+++ b/
fs/squashfs/sqfs.c
@@
-1569,6
+1569,7
@@
int sqfs_size(const char *filename, loff_t *size)
if (!ret)
break;
free(dirs->entry);
+ dirs->entry = NULL;
}
if (ret) {
@@
-1582,6
+1583,7
@@
int sqfs_size(const char *filename, loff_t *size)
ipos = sqfs_find_inode(dirs->inode_table, i_number, sblk->inodes,
sblk->block_size);
free(dirs->entry);
+ dirs->entry = NULL;
base = (struct squashfs_base_inode *)ipos;
switch (get_unaligned_le16(&base->inode_type)) {