From 0278c9fb57adf97cedf4a3bebc37c30371676872 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Wed, 2 Apr 2008 23:50:52 +0200 Subject: [PATCH] For text recovery only check the first 2048 bytes --- src/file_txt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/file_txt.c b/src/file_txt.c index 3afae337..78de7a21 100644 --- a/src/file_txt.c +++ b/src/file_txt.c @@ -423,6 +423,7 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff const char sign_jsp2[] = "<%="; const char sign_php[] = "filename,".html")!=NULL) || /* Text should not be found in JPEG */ (file_recovery->file_stat->file_hint==&file_hint_jpg && - td_memmem(buffer, buffer_size, "8BIM", 4)==NULL && - td_memmem(buffer, buffer_size, "adobe", 5)==NULL) || + td_memmem(buffer, buffer_size_test, "8BIM", 4)==NULL && + td_memmem(buffer, buffer_size_test, "adobe", 5)==NULL) || /* Text should not be found in zip because of compression */ - (file_recovery->file_stat->file_hint==&file_hint_zip && td_memmem(buffer, buffer_size, zip_header, 4)==NULL)) + (file_recovery->file_stat->file_hint==&file_hint_zip && + td_memmem(buffer, buffer_size_test, zip_header, 4)==NULL)) { reset_file_recovery(file_recovery_new); file_recovery_new->data_check=&data_check_txt;