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:
@@ -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 */
|
||||
|
||||
20
ext/exif/tests/bug76130.phpt
Normal file
20
ext/exif/tests/bug76130.phpt
Normal 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===
|
||||
BIN
ext/exif/tests/bug76130_1.jpg
Normal file
BIN
ext/exif/tests/bug76130_1.jpg
Normal file
Binary file not shown.
BIN
ext/exif/tests/bug76130_2.jpg
Normal file
BIN
ext/exif/tests/bug76130_2.jpg
Normal file
Binary file not shown.
Reference in New Issue
Block a user