summaryrefslogtreecommitdiffstats
path: root/src/file_arj.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-05-21 08:57:13 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2010-05-21 08:57:13 +0200
commit41f3bd9b40f3fe5aeb5c66be84d1f37a1c4367f9 (patch)
tree0b7413a640e94baab25033ce5c7d22e7e747ec42 /src/file_arj.c
parent8ebbe0e42e7d201dc75d241dc9acbde7c2fd43ab (diff)
PhotoRec: stricter check for .arj
Diffstat (limited to 'src/file_arj.c')
-rw-r--r--src/file_arj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/file_arj.c b/src/file_arj.c
index 2eba549..1f7a735 100644
--- a/src/file_arj.c
+++ b/src/file_arj.c
@@ -129,8 +129,10 @@ static int header_check_arj(const unsigned char *buffer, const unsigned int buff
{
const struct arj_main_header *arj=(const struct arj_main_header*)buffer;
if(memcmp(buffer, arj_header, sizeof(arj_header))==0 &&
+ le16(arj->basic_header_size) > 0 &&
le16(arj->basic_header_size) <= 2600 &&
arj->archiver_ver_min <= arj->archiver_ver &&
+ arj->archiver_ver <=12 &&
(arj->flags&0x01)==0 &&
arj->file_type==2)
{