diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-09-30 00:07:19 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-09-30 00:07:19 +0000 |
commit | 61994207b8307d76e8c10adf2e8d0b45a8edc23b (patch) | |
tree | 59a88298f7c89940ab099332cfb3216674b7f4a1 | |
parent | 0177e433343205617e8d2408ba38e4c60c101866 (diff) | |
parent | 460a31e0014c39d61cbeb9c5f73e2c7442a6af1b (diff) | |
download | libexif-android11-d1-s7-release.tar.gz |
Merge cherrypicks of [12730462, 12730463, 12729574, 12730525, 12730638, 12730639, 12730640, 12730641, 12730642, 12730643, 12730564, 12730542, 12730526, 12730527, 12730543, 12729545, 12729634, 12730565, 12730531, 12730645, 12730545, 12730406] into rvc-d1-releaseandroid-11.0.0_r15android-11.0.0_r14android-11.0.0_r13android-11.0.0_r12android11-d1-s7-releaseandroid11-d1-s6-releaseandroid11-d1-s5-releaseandroid11-d1-release
Change-Id: I86d4d530c64c924a33ec2470d6c5fbe7682eefc5
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | libexif/exif-entry.c | 7 |
2 files changed, 10 insertions, 1 deletions
@@ -50,6 +50,10 @@ cc_library_shared { "libexif/pentax/mnote-pentax-tag.c", ], + shared_libs: [ + "liblog", + ], + export_include_dirs: ["."], cflags: [ diff --git a/libexif/exif-entry.c b/libexif/exif-entry.c index 4a90842..347539c 100644 --- a/libexif/exif-entry.c +++ b/libexif/exif-entry.c @@ -31,6 +31,8 @@ #include <string.h> #include <time.h> #include <math.h> +#include <limits.h> +#include <log/log.h> #ifndef M_PI #define M_PI 3.14159265358979323846 @@ -1376,7 +1378,10 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen) case EXIF_TAG_XP_SUBJECT: { /* Sanity check the size to prevent overflow */ - if (e->size+sizeof(unsigned short) < e->size) break; + if (e->size > UINT_MAX - sizeof(unsigned short)) { + android_errorWriteLog(0x534e4554, "159625731"); + break; + } /* The tag may not be U+0000-terminated , so make a local U+0000-terminated copy before converting it */ |