summaryrefslogtreecommitdiffstats
path: root/src/ntfs.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-01-14 22:02:41 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-01-14 22:02:41 +0100
commit6240acb4f97f74c38a2a08e2ae2e07461f2bfec5 (patch)
tree3ce33531bf5e7da10826406a70ab45f92330c9c3 /src/ntfs.c
parent9ba29380c83b62499c5d3806d63ff784c526641b (diff)
Don't recover NTFS partition with 0 data sector
Diffstat (limited to 'src/ntfs.c')
-rw-r--r--src/ntfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ntfs.c b/src/ntfs.c
index 11fdacd..9691603 100644
--- a/src/ntfs.c
+++ b/src/ntfs.c
@@ -28,6 +28,7 @@
#include <config.h>
#endif
+#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -128,7 +129,8 @@ int test_NTFS(const disk_t *disk_car,const struct ntfs_boot_sector*ntfs_header,
ntfs_header->dir_entries[0]!=0 || ntfs_header->dir_entries[1]!=0 ||
ntfs_header->sectors[0]!=0 || ntfs_header->sectors[1]!=0 ||
le16(ntfs_header->fat_length)!=0 || le32(ntfs_header->total_sect)!=0 ||
- memcmp(ntfs_header->system_id,"NTFS",4)!=0)
+ memcmp(ntfs_header->system_id,"NTFS",4)!=0 ||
+ le64(ntfs_header->sectors_nbr)==0)
return 1;
switch(ntfs_header->sectors_per_cluster)
{