Skip to content

Commit 7c65345

Browse files
committed
Merge branch 'PHP-7.2'
* PHP-7.2: Fix #76164: exif_read_data zend_mm_heap corrupted
2 parents c8c0bb1 + 281a175 commit 7c65345

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

ext/exif/exif.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,13 +4433,11 @@ PHP_FUNCTION(exif_read_data)
44334433
#ifdef EXIF_DEBUG
44344434
sections_str = exif_get_sectionlist(sections_needed);
44354435
if (!sections_str) {
4436-
zend_string_release(z_sections_needed);
44374436
RETURN_FALSE;
44384437
}
44394438
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Sections needed: %s", sections_str[0] ? sections_str : "None");
44404439
EFREE_IF(sections_str);
44414440
#endif
4442-
zend_string_release(z_sections_needed);
44434441
}
44444442

44454443
if (Z_TYPE_P(stream) == IS_RESOURCE) {

ext/exif/tests/bug76164.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #76164 (exif_read_data zend_mm_heap corrupted)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('exif')) die('skip exif extension not available');
6+
?>
7+
--FILE--
8+
<?php
9+
$var1 = 'nonexistentfile';
10+
$var2 = 2200000000;
11+
@exif_read_data($var1, $var2); // we're not interested in the warning, here
12+
$var2 = 1;
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
===DONE===

0 commit comments

Comments
 (0)