summaryrefslogtreecommitdiffstats
path: root/src/file_zip.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-10-14 22:28:55 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-10-14 22:28:55 +0200
commit01f88e27d0487f411d9f8faf0a6d7113e38e5c61 (patch)
tree0a9ae597ee42ab88a625490f5ed30c29c2eb96e2 /src/file_zip.c
parentc1889a57a1f1b01a49d8b08e92dad15ba9fb0365 (diff)
PhotoRec: fix zip detection
a zip file begins by ZIP_FILE_ENTRY, this signature can also be found for each compressed file
Diffstat (limited to 'src/file_zip.c')
-rw-r--r--src/file_zip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/file_zip.c b/src/file_zip.c
index a3662ab..c7146ca 100644
--- a/src/file_zip.c
+++ b/src/file_zip.c
@@ -737,6 +737,12 @@ static int header_check_zip(const unsigned char *buffer, const unsigned int buff
strcmp(file_recovery->extension,"psmodel")==0)
&& memcmp(&buffer[30], "macrolog_1.mac", 14)==0)
return 0;
+ /* A zip file begins by ZIP_FILE_ENTRY, this signature can also be
+ * found for each compressed file */
+ if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ file_recovery->file_stat->file_hint==&file_hint_zip &&
+ safe_header_only==0)
+ return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->min_filesize=21;
file_recovery_new->file_check=&file_check_zip;