From 85516dbd23e25135236ffb441d61dcdefd96eeaf Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 4 Mar 2019 14:58:46 +0100 Subject: - exif: Fix #77509 Uninitialized read in exif_process_IFD_in_TIFF Fix #77540 Invalid Read on exif_process_SOFn Fix #77563 Uninitialized read in exif_process_IFD_in_MAKERNOTE Fix #77659 Uninitialized read in exif_process_IFD_in_MAKERNOTE --- php-bug77563.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 php-bug77563.patch (limited to 'php-bug77563.patch') diff --git a/php-bug77563.patch b/php-bug77563.patch new file mode 100644 index 0000000..33b196d --- /dev/null +++ b/php-bug77563.patch @@ -0,0 +1,42 @@ +Backported for 5.6 from 7.1 by remi +without binary diff + + + +From 8ac6fee8562533a15db90062117210ed28b44fea Mon Sep 17 00:00:00 2001 +From: Stanislav Malyshev +Date: Sat, 2 Mar 2019 15:07:40 -0800 +Subject: [PATCH] Fix bug #77563 - Uninitialized read in + exif_process_IFD_in_MAKERNOTE + +Also fix for bug #77659 +--- + ext/exif/exif.c | 3 ++- + ext/exif/tests/bug77563.jpg | Bin 0 -> 63 bytes + ext/exif/tests/bug77563.phpt | 16 ++++++++++++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) + create mode 100644 ext/exif/tests/bug77563.jpg + create mode 100644 ext/exif/tests/bug77563.phpt + +diff --git a/ext/exif/exif.c b/ext/exif/exif.c +index ea88a8f115e8..fe89b8547118 100644 +--- a/ext/exif/exif.c ++++ b/ext/exif/exif.c +@@ -2751,7 +2751,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu + break; + } + +- if (maker_note->offset >= value_len) { ++ if (value_len < 2 || maker_note->offset >= value_len - 1) { + /* Do not go past the value end */ + exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset); + return FALSE; +@@ -2804,6 +2804,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu + break; + default: + case MN_OFFSET_NORMAL: ++ data_len = value_len; + break; + } + + -- cgit