summaryrefslogtreecommitdiffstats
path: root/src/file_bac.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-07-24 23:24:56 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-07-24 23:24:56 +0200
commit00088b523ebe635facabe73fcdb46a78b17f810e (patch)
treed33359cd8fd3122fe45f52109719521c19955b1e /src/file_bac.c
parent3af4dc91f87ea9da9f839daf48f0fdb636c0c081 (diff)
PhotoRec: limit data check for .bac to compatible blocksize
Diffstat (limited to 'src/file_bac.c')
-rw-r--r--src/file_bac.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/file_bac.c b/src/file_bac.c
index 395eb07..6e60aae 100644
--- a/src/file_bac.c
+++ b/src/file_bac.c
@@ -47,6 +47,12 @@ const file_hint_t file_hint_bac= {
static data_check_t data_check_bac(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
+ if(buffer_size < 2*0x18)
+ {
+ file_recovery->data_check=NULL;
+ file_recovery->file_check=NULL;
+ return DC_CONTINUE;
+ }
while(file_recovery->calculated_file_size + buffer_size/2 >= file_recovery->file_size &&
file_recovery->calculated_file_size + 0x18 < file_recovery->file_size + buffer_size/2)
{