From c566d9ade4d988f72b723b92765d0cc9117c772b Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 13 Feb 2016 16:09:09 +0100 Subject: [PATCH] PhotoRec: Avoid false positive for .plist with .qbb and .sqlite --- src/file_plist.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/file_plist.c b/src/file_plist.c index d0335494..fdb0ae0e 100644 --- a/src/file_plist.c +++ b/src/file_plist.c @@ -30,6 +30,8 @@ #include "types.h" #include "filegen.h" +extern const file_hint_t file_hint_qbb; +extern const file_hint_t file_hint_sqlite; static void register_header_check_plist(file_stat_t *file_stat); @@ -44,6 +46,15 @@ const file_hint_t file_hint_plist= { static int header_check_plist(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->file_stat!=NULL) + { + if( file_recovery->file_stat->file_hint==&file_hint_qbb || + file_recovery->file_stat->file_hint==&file_hint_sqlite) + { + header_ignored(file_recovery_new); + return 0; + } + } reset_file_recovery(file_recovery_new); file_recovery_new->extension=file_hint_plist.extension; return 1;