diff options
author | Sungsoo Lim <sungsoo@google.com> | 2016-07-20 10:37:20 +0900 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-07-21 17:03:44 -0700 |
commit | 397cb186fb2ee5997f078bebe290f2df464dea39 (patch) | |
tree | 7d5ebb66089de9bba339e8d830cf8a63cce766f8 | |
parent | 1a6abbd01f0b6903805078c0f187656eac3684fe (diff) | |
download | jhead-marshmallow-dr1.6-release.tar.gz |
Fix possible out of bounds accessesandroid-6.0.1_r68android-6.0.1_r67marshmallow-dr1.6-release
Bug: 30074856
Change-Id: I1a1387ed29d2e0d010b0d5d4bb3d29453a3a7666
-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; |