summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2016-06-10 21:49:43 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-06-10 21:49:43 +0000
commite3574d919b171dd0c5a3710bd90350abaa609c6c (patch)
treee6c1fac71143a5b0cde5934c99649cf6d3528b8d
parent5c8f937269957e6651383e988006824781fd021a (diff)
parent2ea3783c815f703030583f31a6b8292713a12f72 (diff)
downloadjhead-e3574d919b171dd0c5a3710bd90350abaa609c6c.tar.gz
Fix possible out of bounds access am: 751b4eba25 am: b201f04d8c am: 2d49e2de6e am: a3c15ad42d am: 6c2d0e45b5 am: dbefc1dc4a am: 854fedfa6b
am: 2ea3783c81 Change-Id: I5defd464180336f6e8cafd67ef8c9d7f575c34b3
-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;