From 5f7c535b55a9dfebe0058c7e373a0c297651a6c5 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Mon, 9 Jan 2012 03:27:29 +0100 Subject: [PATCH] utils.c: Fixed apparently incorrect initial value of 'bmpmref'. This bug led 'utils_mftrec_in_use' to use 'cached' data before it had been initialized (i.e. its contents was undefined), producing incorrect results for the first 3584 MFT entries. --- ntfsprogs/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index e3f5447e..2836723d 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -782,7 +782,7 @@ int utils_cluster_in_use(ntfs_volume *vol, long long lcn) int utils_mftrec_in_use(ntfs_volume *vol, MFT_REF mref) { static u8 buffer[512]; - static s64 bmpmref = -sizeof(buffer) - 1; /* Which bit of $BITMAP is in the buffer */ + static s64 bmpmref = -(sizeof(buffer) << 3) - 1; /* Which bit of $BITMAP is in the buffer */ int byte, bit; ntfs_log_trace("Entering.\n"); -- 2.11.0