diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-01 11:08:20 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-01 11:46:40 +0200 |
commit | f0d18050d832498c8e230c04084675455fef391f (patch) | |
tree | b2293459cc395f449ff5f648b23b87cf6270dd85 /lib/sqfs/id_table_read.c | |
parent | 2f5bbf17fd23ba305d0b5cb1fb595123283df8bc (diff) |
Make sure fragment and id tables are initialized
In case the tables are not completely filled by reading from the
squashfs image.
Bug found using scan-build.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/id_table_read.c')
-rw-r--r-- | lib/sqfs/id_table_read.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqfs/id_table_read.c b/lib/sqfs/id_table_read.c index 6e1789d..58b0cf9 100644 --- a/lib/sqfs/id_table_read.c +++ b/lib/sqfs/id_table_read.c @@ -28,7 +28,7 @@ int id_table_read(id_table_t *tbl, int fd, sqfs_super_t *super, return -1; } - tbl->ids = malloc(super->id_count * sizeof(uint32_t)); + tbl->ids = calloc(super->id_count, sizeof(uint32_t)); if (tbl->ids == NULL) { perror("reading ID table"); return -1; |