]> granicus.if.org Git - php/commitdiff
Changed the way MAKERNOTE is handled in case we do not have a matching signature...
authorKalle Sommer Nielsen <kalle@php.net>
Wed, 3 Aug 2016 15:05:31 +0000 (17:05 +0200)
committerDavey Shafik <me@daveyshafik.com>
Wed, 3 Aug 2016 19:29:03 +0000 (12:29 -0700)
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.

ext/exif/exif.c

index f62f77a60f5fab7650c479f6f0146354d50aae51..1dfa956aceac3097ed6a29378572b7a8fe5b42c3 100644 (file)
@@ -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));