]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fs/squashfs: sqfs_read: fix dangling pointer dirs->entry
authorRichard Genoud <richard.genoud@posteo.net>
Tue, 3 Nov 2020 11:11:11 +0000 (12:11 +0100)
committerTom 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

index f4cac3e4bf032abcd29ad24f19672cfd18d6a970..13e64bea9346987ceff62a9690acca6f2772e479 100644 (file)
@@ -1336,6 +1336,7 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
                        break;
 
                free(dirs->entry);
+               dirs->entry = NULL;
        }
 
        if (ret) {