summaryrefslogtreecommitdiffstats
path: root/src/file_iso.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-07-26 16:11:29 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-07-26 16:11:29 +0200
commita9e41223495e4f19ec45178b3500ee23687cd759 (patch)
tree7e049181b9661e6f8c30a4dedc52718b40d7ec3c /src/file_iso.c
parentc5e019c208c530e1c75ad7ad02d238b3e23f029d (diff)
PhotoRec: stricter check for .iso
Diffstat (limited to 'src/file_iso.c')
-rw-r--r--src/file_iso.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/file_iso.c b/src/file_iso.c
index 430419f..c94e7d8 100644
--- a/src/file_iso.c
+++ b/src/file_iso.c
@@ -62,17 +62,23 @@ static int header_check_db(const unsigned char *buffer, const unsigned int buffe
const unsigned int volume_space_size2=iso1->volume_space_size[7] | (iso1->volume_space_size[6]<<8) | (iso1->volume_space_size[5]<<16) | (iso1->volume_space_size[4]<<24);
const unsigned int logical_block_size=iso1->logical_block_size[0] | (iso1->logical_block_size[1]<<8);
const unsigned int logical_block_size2=iso1->logical_block_size[3] | (iso1->logical_block_size[2]<<8);
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_iso.extension;
if(volume_space_size==volume_space_size2 && logical_block_size==logical_block_size2)
{ /* ISO 9660 */
- file_recovery_new->calculated_file_size=(uint64_t)volume_space_size * logical_block_size;
+ const uint64_t size=(uint64_t)volume_space_size * logical_block_size;
+ if(size < 0x8000+512)
+ return 0;
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_iso.extension;
+ file_recovery_new->calculated_file_size=size;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
+ file_recovery_new->min_filesize=0x8000+512;
+ return 1;
}
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_iso.extension;
+ file_recovery_new->min_filesize=0x8000+512;
return 1;
}
return 0;
}
-
-