aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Genoud <richard.genoud@posteo.net>2020-11-03 12:11:09 +0100
committerTom Rini <trini@konsulko.com>2020-11-19 09:45:49 -0500
commit508a9dc7f694df11c7de7460f888f508e40a2046 (patch)
tree4ae83298124fa6a16cf7e457b795894fbf74ca8c
parentdc3312c43c82ff9335b2bf4ee4f72365e824adfd (diff)
downloadu-boot-508a9dc7f694df11c7de7460f888f508e40a2046.zip
u-boot-508a9dc7f694df11c7de7460f888f508e40a2046.tar.gz
u-boot-508a9dc7f694df11c7de7460f888f508e40a2046.tar.bz2
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>
-rw-r--r--fs/squashfs/sqfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 7da2e09..3b008b5 100644
--- 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)) {