diff options
author | Sungsoo Lim <sungsoo@google.com> | 2016-07-20 17:09:36 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-07-20 17:09:36 +0000 |
commit | 1583b768effff71a91a3a358a1e051a460bc3635 (patch) | |
tree | 7d5ebb66089de9bba339e8d830cf8a63cce766f8 | |
parent | 2a4c12f5e5808e309b9ba04fe8b1539debf466d1 (diff) | |
parent | edad75e21a34b9e41e4b0bab97127800c1a0d3b9 (diff) | |
download | jhead-1583b768effff71a91a3a358a1e051a460bc3635.tar.gz |
Fix possible out of bounds accesses am: ee54e6ceb6 am: 4c7c4297b5 am: 364ccf5071 am: fb76bf3245 am: 1a484d2270 am: d98576d450 am: de4cdf8758 am: d3d573ee65 am: f3d69fbae8
am: edad75e21a
Change-Id: I33dd2ce62cb0c65a6bea4923991d2755b0213b48
-rw-r--r-- | gpsinfo.c | 2 | ||||
-rw-r--r-- | makernote.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -174,7 +174,7 @@ void ProcessGpsInfo(unsigned char * DirStart, int ByteCountUnused, unsigned char 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; diff --git a/makernote.c b/makernote.c index cf40c6b..514518d 100644 --- a/makernote.c +++ b/makernote.c @@ -62,7 +62,7 @@ void ProcessCanonMakerNoteDir(unsigned char * DirStart, unsigned char * OffsetBa 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; |