summaryrefslogtreecommitdiffstats
path: root/src/file_fcs.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-06-16 13:53:05 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2017-06-16 13:53:05 +0200
commitc16a893f92fb807ac8cb9c76e065c0dfbf45cc2d (patch)
tree40fe006eb69c84bdc6593b7d2a89c2e1cc78f03e /src/file_fcs.c
parent0db61bd22d1a67863a4510a82c5d0dda3f608165 (diff)
src/file_fcs.c: fix potential oob read.
Thanks to Adel KHALDI from Blue Frost Security GmbH for reporting the problem.
Diffstat (limited to 'src/file_fcs.c')
-rw-r--r--src/file_fcs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/file_fcs.c b/src/file_fcs.c
index b1bfc96..fbd3ef0 100644
--- a/src/file_fcs.c
+++ b/src/file_fcs.c
@@ -112,7 +112,7 @@ static int header_check_fcs(const unsigned char *buffer, const unsigned int buff
analysis_end=ascii2int(fcs->analysis_end, 8);
if(!(text_start<=text_end && data_start<=data_end && analysis_start<=analysis_end))
return 0;
- if(data_end==0 || analysis_end==0)
+ if((data_end==0 || analysis_end==0) && text_start < buffer_size)
{ /* Explore TEXT segment */
unsigned int i;
const char delimiter=buffer[text_start];