mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-24 07:32:01 +00:00
fs/squashfs: sqfs_size: fix dangling pointer dirs->entry
dirs->entry shouldn't be left dangling as it could be freed twice. Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
This commit is contained in:
parent
dc3312c43c
commit
508a9dc7f6
1 changed files with 2 additions and 0 deletions
|
@ -1569,6 +1569,7 @@ int sqfs_size(const char *filename, loff_t *size)
|
||||||
if (!ret)
|
if (!ret)
|
||||||
break;
|
break;
|
||||||
free(dirs->entry);
|
free(dirs->entry);
|
||||||
|
dirs->entry = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret) {
|
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,
|
ipos = sqfs_find_inode(dirs->inode_table, i_number, sblk->inodes,
|
||||||
sblk->block_size);
|
sblk->block_size);
|
||||||
free(dirs->entry);
|
free(dirs->entry);
|
||||||
|
dirs->entry = NULL;
|
||||||
|
|
||||||
base = (struct squashfs_base_inode *)ipos;
|
base = (struct squashfs_base_inode *)ipos;
|
||||||
switch (get_unaligned_le16(&base->inode_type)) {
|
switch (get_unaligned_le16(&base->inode_type)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue