From ec7bf5437738fa56c2e259521e3a18c972ac76be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 12 Jul 2021 08:31:18 +0200 Subject: [PATCH] Checked the MFTMirr lcn to be consistent with the boot sector The lcn of the initial run of the MFTMirr data must be the same as described in the boot sector. As a consequence this cannot be a hole. --- libntfs-3g/volume.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libntfs-3g/volume.c b/libntfs-3g/volume.c index e6ec498b..a6551c78 100644 --- a/libntfs-3g/volume.c +++ b/libntfs-3g/volume.c @@ -458,6 +458,12 @@ static int ntfs_mftmirr_load(ntfs_volume *vol) ntfs_log_perror("Failed to map runlist of $MFTMirr/$DATA"); goto error_exit; } + if (vol->mftmirr_na->rl->lcn != vol->mftmirr_lcn) { + ntfs_log_error("Bad $MFTMirr lcn 0x%llx, want 0x%llx\n", + (long long)vol->mftmirr_na->rl->lcn, + (long long)vol->mftmirr_lcn); + goto error_exit; + } return 0;