summaryrefslogtreecommitdiffstats
path: root/src/file_wv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-08-13 08:44:26 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-08-13 08:44:26 +0200
commit914eefbdc0530a1d1eede56d8ad287e29aed9118 (patch)
treef77dc051b487f2c7a5d3a339b3b33d94b9830e3d /src/file_wv.c
parent3f57b7aa55e4c275a97af3d526d8e6b4f738daee (diff)
PhotoRec: stricter check for .wv
Diffstat (limited to 'src/file_wv.c')
-rw-r--r--src/file_wv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/file_wv.c b/src/file_wv.c
index 0fe7220..433bc18 100644
--- a/src/file_wv.c
+++ b/src/file_wv.c
@@ -69,11 +69,15 @@ static int header_check_wv(const unsigned char *buffer, const unsigned int buffe
const WavpackHeader *wv=(const WavpackHeader*)buffer;
if(le32(wv->block_index)!=0)
return 0;
+ if(sizeof(WavpackHeader) > le32(wv->ckSize)+8)
+ return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_wv.extension;
+ file_recovery_new->min_filesize=le32(wv->ckSize)+8;
if(file_recovery_new->blocksize < 8)
return 1;
file_recovery_new->data_check=&data_check_wv;
+ file_recovery_new->file_check=&file_check_size;
return 1;
}