diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-11-07 17:06:33 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-11-07 17:06:33 +0100 |
commit | 835c3b0acc65758733bbb9fefbdf1cce7fa61e10 (patch) | |
tree | df2594a8e79244fecf1a22b5694ce8aa8030f825 /lib/sqfs/xattr/xattr_writer.c | |
parent | 411f659fe0140bacbd56f8503cda269816d4a887 (diff) |
Fix: libsquashfs: xattr_writer: return NULL if calloc fails
Instead of dereferencing the NULL pointer and crashing.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/xattr/xattr_writer.c')
-rw-r--r-- | lib/sqfs/xattr/xattr_writer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqfs/xattr/xattr_writer.c b/lib/sqfs/xattr/xattr_writer.c index c33d366..c04bd4a 100644 --- a/lib/sqfs/xattr/xattr_writer.c +++ b/lib/sqfs/xattr/xattr_writer.c @@ -89,6 +89,9 @@ sqfs_xattr_writer_t *sqfs_xattr_writer_create(sqfs_u32 flags) return NULL; xwr = calloc(1, sizeof(*xwr)); + if (xwr == NULL) + return NULL; + if (str_table_init(&xwr->keys, XATTR_KEY_BUCKETS)) goto fail_keys; |