summaryrefslogtreecommitdiffstats
path: root/src/file_jpg.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_jpg.c
parente0d2dc2f39b3cec37308b470d872974afd0e54b2 (diff)
PhotoRec: fix bound check when parsing exe, fits, jpg, mp3, riff, zip
Diffstat (limited to 'src/file_jpg.c')
-rw-r--r--src/file_jpg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/file_jpg.c b/src/file_jpg.c
index 261be27..8c8ae08 100644
--- a/src/file_jpg.c
+++ b/src/file_jpg.c
@@ -1349,7 +1349,7 @@ static int jpg_check_dht(const unsigned char *buffer, const unsigned int buffer_
return 2;
j++;
for(l=0; l < 16; l++)
- if(j < buffer_size)
+ if(j+l < buffer_size)
sum+=buffer[j+l];
if(sum>255)
return 2;