[PATCH 3/8] libxfs: fix setup_cursor array allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 repair/phase5.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/repair/phase5.c b/repair/phase5.c
index 7d5cd49..1f71cac 100644
--- a/repair/phase5.c
+++ b/repair/phase5.c
@@ -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"));
 
-- 
1.7.1

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux