]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: fix setup_cursor array allocation
authorEric Sandeen <sandeen@redhat.com>
Sat, 26 Jan 2013 22:40:27 +0000 (22:40 +0000)
committerMark Tinguely <tinguely@eagdhcp-232-136.americas.sgi.com>
Thu, 21 Feb 2013 16:09:11 +0000 (10:09 -0600)
setup_cursor() wants an array of xfs_agbno_t's, but
it allocated a multiple of *pointers* to xfs_agbno_t's.
xfs_agbno_t is 4 bytes, so this is harmless other than
allocating twice as much memory as needed on a 64-bit
machine.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
repair/phase5.c

index 7d5cd49a1fcf857344d080edc45f8a4cd0b85052..1f71caca5952e8f8a21c165a9298af3de848c830 100644 (file)
@@ -206,7 +206,7 @@ setup_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *curs)
 
        ASSERT(big_extent_len > 0);
 
-       if ((curs->btree_blocks = malloc(sizeof(xfs_agblock_t *)
+       if ((curs->btree_blocks = malloc(sizeof(xfs_agblock_t)
                                        * big_extent_len)) == NULL)
                do_error(_("could not set up btree block array\n"));