From cb1b5b67dbd503ac692d278a32d9d569e49456b7 Mon Sep 17 00:00:00 2001 From: szaka Date: Mon, 30 Mar 2009 10:57:34 +0000 Subject: [PATCH] fix potential heap corruption when allocating an extent mft record --- libntfs-3g/mft.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libntfs-3g/mft.c b/libntfs-3g/mft.c index 8158f240..dc47f61f 100644 --- a/libntfs-3g/mft.c +++ b/libntfs-3g/mft.c @@ -1459,7 +1459,7 @@ found_free_rec: free(ni); goto undo_mftbmp_alloc; } - if (base_ni->extent_nis) { + if (base_ni->nr_extents) { memcpy(extent_nis, base_ni->extent_nis, i - 4 * sizeof(ntfs_inode *)); free(base_ni->extent_nis); @@ -1761,7 +1761,7 @@ found_free_rec: free(ni); goto undo_mftbmp_alloc; } - if (base_ni->extent_nis) { + if (base_ni->nr_extents) { memcpy(extent_nis, base_ni->extent_nis, i - 4 * sizeof(ntfs_inode *)); free(base_ni->extent_nis);