com php-src: Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).: ext/exif/exif.c
| From: | Davey Shafik | Date: | Wed, 03 Aug 2016 19:29:03 +0000 |
| Subject: | com php-src: Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).: ext/exif/exif.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93593@lists.php.net to get a copy of this message | ||
Commit: 835ef14979c6953cbe9b4ead58649c587ccfe2ba
Author: Kalle Sommer Nielsen <kalle@php.net> Wed, 3 Aug 2016 17:05:31 +0200
Committer: Davey Shafik <me@daveyshafik.com> Wed, 3 Aug 2016 12:29:03 -0700
Parents: 6822af2e738698aab9fa34ca0c572309960bcd74
Branches: PHP-7.1
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=835ef14979c6953cbe9b4ead58649c587ccfe2ba
Log:
Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the
EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a
security fix for MAKERNOTE.
The new behavior is to instead of stopping to parse, to continue so we can still fetch data like
thumbnail and GPS, thrus allowing yet unsupported formats to parse. If EXIF's debugging mode is
enabled, a notice will display in case we do not match against a valid MAKERNOTE signature.
This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images)
until I get around to debug it further.
Bugs:
https://bugs.php.net/72682
Changed paths:
M ext/exif/exif.c
Diff:
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index f62f77a..1dfa956 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -1702,6 +1702,10 @@ static void exif_iif_add_value(image_info_type *image_info, int
section_index, c
if (!length)
break;
case TAG_FMT_UNDEFINED:
+ if (tag == TAG_MAKER_NOTE) {
+ length = MIN(length, strlen(value));
+ }
+
if (value) {
if (tag == TAG_MAKER_NOTE) {
length = MIN(length, strlen(value));