]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: Fix malloc size of rt_ext_tree_ptr
authorEric Sandeen <sandeen@sandeen.net>
Mon, 3 Aug 2015 22:36:41 +0000 (08:36 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 3 Aug 2015 22:36:41 +0000 (08:36 +1000)
rt_ext_tree_ptr points to an avl64tree_desc_t, but we malloc memory
according to the size of avltree_desc_t.  Oddly, the latter happens
to be larger, so we're ok, but may as well make it correct.

Addresses-Coverity-Id: 1297533
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/incore_ext.c

index 826bf44b2472c21be2fb4e947a509a3199d71e78..6611d5ce2df50f19010b7a3f540a0f22e1e9be59 100644 (file)
@@ -783,7 +783,7 @@ incore_ext_init(xfs_mount_t *mp)
                avl_init_tree(extent_bcnt_ptrs[i], &avl_extent_bcnt_tree_ops);
        }
 
-       if ((rt_ext_tree_ptr = malloc(sizeof(avltree_desc_t))) == NULL)
+       if ((rt_ext_tree_ptr = malloc(sizeof(avl64tree_desc_t))) == NULL)
                do_error(_("couldn't malloc dup rt extent tree descriptor\n"));
 
        avl64_init_tree(rt_ext_tree_ptr, &avl64_extent_tree_ops);