summaryrefslogtreecommitdiffstats
path: root/src/file_dad.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-07-26 15:31:46 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-07-26 15:31:46 +0200
commit3e7f9f3eedc727b32ec1c6dc1ce9e2f9e4f2a32c (patch)
tree2022e3e7bdebbfb805714217e6484037e5924338 /src/file_dad.c
parente1d8877998358ea54dd425d1c6d55e3085d8b9d5 (diff)
PhotoRec: disable check of .dad for small blocksize
Diffstat (limited to 'src/file_dad.c')
-rw-r--r--src/file_dad.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/file_dad.c b/src/file_dad.c
index b104da3..17712da 100644
--- a/src/file_dad.c
+++ b/src/file_dad.c
@@ -73,13 +73,19 @@ static data_check_t data_check_dad(const unsigned char *buffer, const unsigned i
static int header_check_dad(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
- if(file_recovery!=NULL && file_recovery->data_check==&data_check_dad &&
- file_recovery->calculated_file_size==file_recovery->file_size)
+ if(file_recovery!=NULL &&
+ file_recovery->file_stat!=NULL &&
+ file_recovery->file_stat->file_hint==&file_hint_dad &&
+ (file_recovery->calculated_file_size==file_recovery->file_size ||
+ file_recovery->blocksize < 16))
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_dad.extension;
- file_recovery_new->data_check=&data_check_dad;
- file_recovery_new->file_check=&file_check_size;
+ if(file_recovery_new->blocksize >= 16)
+ {
+ file_recovery_new->data_check=&data_check_dad;
+ file_recovery_new->file_check=&file_check_size;
+ }
return 1;
}