diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-09 19:40:31 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-09 19:40:31 +0200 |
commit | 6b875fa3abc98536ad94d186876af67f6162969d (patch) | |
tree | 08aba822fcbd75017b8ef388aaa06d7b60e79901 /lib | |
parent | 85e8baf6fd2b8f4a92f420ac8eb799964bd8550e (diff) |
Sanity check id table size read from super block
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sqfs/read_super.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqfs/read_super.c b/lib/sqfs/read_super.c index 801bf7f..7b738ea 100644 --- a/lib/sqfs/read_super.c +++ b/lib/sqfs/read_super.c @@ -88,6 +88,11 @@ int sqfs_super_read(sqfs_super_t *super, int fd) return -1; } + if (temp.id_count == 0) { + fputs("ID table in squashfs image is empty.\n", stderr); + return -1; + } + memcpy(super, &temp, sizeof(temp)); return 0; fail_seek: |