From 00088b523ebe635facabe73fcdb46a78b17f810e Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Thu, 24 Jul 2014 23:24:56 +0200 Subject: [PATCH] PhotoRec: limit data check for .bac to compatible blocksize --- src/file_bac.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/file_bac.c b/src/file_bac.c index 395eb07f..6e60aaec 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) {