summaryrefslogtreecommitdiffstats
path: root/src/file_riff.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-02-18 09:58:02 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2018-02-18 09:58:02 +0100
commitfe2059efa9959386b7ad2e1d5a72154800242a97 (patch)
tree7ff5e3f74460497108ce2a00682c40ebec0365e4 /src/file_riff.c
parente0d2dc2f39b3cec37308b470d872974afd0e54b2 (diff)
PhotoRec: fix bound check when parsing exe, fits, jpg, mp3, riff, zip
Diffstat (limited to 'src/file_riff.c')
-rw-r--r--src/file_riff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/file_riff.c b/src/file_riff.c
index f6cc5ca..dedc297 100644
--- a/src/file_riff.c
+++ b/src/file_riff.c
@@ -259,7 +259,7 @@ static int header_check_riff(const unsigned char *buffer, const unsigned int buf
reset_file_recovery(file_recovery_new);
file_recovery_new->extension="avi";
/* Is it a raw avi stream with Data Binary chunks ? */
- if(size + 4 < buffer_size &&
+ if(size < buffer_size - 4 &&
memcmp(&buffer[size - sizeof(list_movi)], &list_movi, sizeof(list_movi)) ==0 &&
buffer[size+2]=='d' &&
buffer[size+3]=='b')