commit | 8cace45722cbdcf3617240e8aea69e4cb731c488 | [log] [tgz] |
---|---|---|
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | Tue May 10 21:53:25 2022 +0200 |
committer | Tom Rini <trini@konsulko.com> | Mon Jun 06 17:47:17 2022 -0400 |
tree | 34ef2872914679f5c2c7831b5980a11d14a0b756 | |
parent | e7269b72294015d27665879915817487865d6bc2 [diff] [blame] |
fs/squashfs: fix sqfs_read_sblk() Setting sblk = NULL has no effect on the caller. We want to set *sblk = NULL if an error occurrs to avoid usage after free. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c index 547d2fd..90bf32c 100644 --- a/fs/squashfs/sqfs.c +++ b/fs/squashfs/sqfs.c
@@ -49,7 +49,7 @@ if (sqfs_disk_read(0, 1, *sblk) != 1) { free(*sblk); - sblk = NULL; + *sblk = NULL; return -EINVAL; }