summaryrefslogtreecommitdiffstats
path: root/src/file_psp.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-08-13 08:34:28 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-08-13 08:34:28 +0200
commit5b68d5ea9567b18759dffef60a2bdf1963220133 (patch)
treef5eaa06a5236db07e732ae4bb706dd029f5dd387 /src/file_psp.c
parentd4d0b0689899732db803265175332ed87c43cc75 (diff)
PhotoRec: stricter check for .psp
Diffstat (limited to 'src/file_psp.c')
-rw-r--r--src/file_psp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/file_psp.c b/src/file_psp.c
index 4b39133..1da02d4 100644
--- a/src/file_psp.c
+++ b/src/file_psp.c
@@ -74,6 +74,8 @@ static data_check_t data_check_psp(const unsigned char *buffer, const unsigned i
static int header_check_psp(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)
{
const unsigned int ver_major=buffer[0x20]+(buffer[0x21]<<8);
+ if(memcmp(&buffer[0x24], "~BK\0", 4)!=0)
+ return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_psp.extension;
if(ver_major>=4 && file_recovery_new->blocksize >= 16)