summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2016-06-10 21:38:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-06-10 21:38:13 +0000
commitdbefc1dc4a7ea50d7a09f7799fe4aa20ca227433 (patch)
tree02cce0896b530595982270ec0dfc3163c65a7321
parentafe9f55ee6ba3eaee02e7b13809a534ebe98d34a (diff)
parent6c2d0e45b56eda4d73e8b9f6ac901753f1b68bf9 (diff)
downloadjhead-dbefc1dc4a7ea50d7a09f7799fe4aa20ca227433.tar.gz
Fix possible out of bounds access am: 751b4eba25 am: b201f04d8c am: 2d49e2de6e am: a3c15ad42d
am: 6c2d0e45b5 Change-Id: Ib451525a44fed7f50d93fbcb7c7614ff874834b6
-rw-r--r--exif.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exif.c b/exif.c
index 472c45e..64ef19a 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;