summaryrefslogtreecommitdiffstats
path: root/src/ntfs_adv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-04-09 12:47:46 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-04-09 12:47:46 +0200
commit52190cd076ba6b47d59eeaf888a5f0029bd8d3a1 (patch)
tree2267881d32eb43080c91c7f9bfc71f2de56632fa /src/ntfs_adv.c
parentc19f6a3a120ccbf21677c06b93be221947830877 (diff)
rebuild_NTFS_BS: add a safety check for mft_record_size
Diffstat (limited to 'src/ntfs_adv.c')
-rw-r--r--src/ntfs_adv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ntfs_adv.c b/src/ntfs_adv.c
index 9cadaae..44428e5 100644
--- a/src/ntfs_adv.c
+++ b/src/ntfs_adv.c
@@ -653,7 +653,7 @@ int rebuild_NTFS_BS(disk_t *disk_car, partition_t *partition, const int verbose,
}
#endif
/* TODO read_mft_info(partition,sector,*sectors_per_cluster,*mft_lcn,*mftmirr_lcn,*mft_record_size); */
- if(sectors_per_cluster>0 && mft_record_size>0)
+ if(sectors_per_cluster>0 && mft_record_size>0 && mft_record_size <= sizeof(buffer))
{
// 0x90 AT_INDEX_ROOT
const ntfs_attribheader *attr90;