1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 19:41:05 +02:00

Merge remote-tracking branch 'security/PHP-5.6' into PHP-5.6

* security/PHP-5.6:
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
This commit is contained in:
Stanislav Malyshev
2018-04-23 13:42:51 -07:00
4 changed files with 21 additions and 1 deletions

View File

@@ -1710,7 +1710,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
case TAG_FMT_UNDEFINED:
if (value) {
if (tag == TAG_MAKER_NOTE) {
length = MIN(length, strlen(value));
length = (int) php_strnlen(value, length);
}
/* do not recompute length here */

View File

@@ -0,0 +1,20 @@
--TEST--
Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value)
--DESCRIPTION--
This test is meant to exhibit memory issues with the `-m` option. Since a lot of
notices and warnings are to be expected anyway, we suppress these, since the are
not relevant for this test.
--INI--
error_reporting=E_ALL & ~E_WARNING & ~E_NOTICE
--SKIPIF--
<?php
if (!extension_loaded('exif')) die('skip exif extension not available');
?>
--FILE--
<?php
exif_read_data(__DIR__ . '/bug76130_1.jpg');
exif_read_data(__DIR__ . '/bug76130_2.jpg');
?>
===DONE===
--EXPECT--
===DONE===

Binary file not shown.

Binary file not shown.