summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2016-06-09 14:07:50 -0700
committergitbuildkicker <android-build@google.com>2016-07-21 15:01:26 -0700
commit9cbb652787074a984146c32d1a6e4799ead6ceb8 (patch)
treee6c1fac71143a5b0cde5934c99649cf6d3528b8d
parent5c8f937269957e6651383e988006824781fd021a (diff)
downloadjhead-marshmallow-dr-dragon-release.tar.gz
Fix possible out of bounds accessandroid-6.0.1_r63marshmallow-dr-dragon-release
Bug: 28868315 Change-Id: I2b416c662f9ad7f9b3c6cf973a39c6693c66775a (cherry picked from commit 751b4eba25aa2e2a31232c9c25ceb6dbddfb1d93)
-rw-r--r--exif.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exif.c b/exif.c
index 8dfdaf1..0abfa1d 100644
--- a/exif.c
+++ b/exif.c
@@ -614,7 +614,7 @@ static void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase,
unsigned OffsetVal;
OffsetVal = Get32u(DirEntry+8);
// If its bigger than 4 bytes, the dir entry contains an offset.
- if (OffsetVal+ByteCount > ExifLength){
+ if (OffsetVal > UINT32_MAX - ByteCount || OffsetVal+ByteCount > ExifLength){
// Bogus pointer offset and / or bytecount value
ErrNonfatal("Illegal value pointer for tag %04x", Tag,0);
continue;