summaryrefslogtreecommitdiffstats
path: root/src/file_3dm.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-08-09 09:34:43 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-08-09 09:34:43 +0200
commit54d564d074d34d0782290762e1df02a21dde07fd (patch)
tree021a3ea5e5d82a181cdc88d272a198611801d64e /src/file_3dm.c
parent1408597b6040330f98cf145b42034a2a01459073 (diff)
PhotoRec: stricter check for .3dm
Diffstat (limited to 'src/file_3dm.c')
-rw-r--r--src/file_3dm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/file_3dm.c b/src/file_3dm.c
index 5c81e9d..76677e4 100644
--- a/src/file_3dm.c
+++ b/src/file_3dm.c
@@ -44,6 +44,10 @@ const file_hint_t file_hint_3dm= {
static int header_check_3dm(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)
{
+ unsigned int i;
+ for(i=24; i<buffer_size && buffer[i]==' '; i++);
+ if(i>=buffer_size || buffer[i]<'0' || buffer[i]>'9')
+ return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_3dm.extension;
return 1;