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

Merge branch 'PHP-7.2'

* PHP-7.2:
  Fix #76409: heap use after free in _php_stream_free
This commit is contained in:
Christoph M. Becker
2018-06-09 17:57:10 +02:00
2 changed files with 15 additions and 1 deletions

View File

@@ -4297,7 +4297,7 @@ static int exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream, i
zend_string *base;
if ((st.st_mode & S_IFMT) != S_IFREG) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Not a file");
php_stream_close(ImageInfo->infile);
ImageInfo->infile = NULL;
return FALSE;
}

View File

@@ -0,0 +1,14 @@
--TEST--
Bug #76409 (heap use after free in _php_stream_free)
--SKIPIF--
<?php
if (!extension_loaded('exif')) die('skip exif extension not available');
?>
--FILE--
<?php
exif_read_data('.');
?>
===DONE===
--EXPECTF--
Warning: exif_read_data(): Not a file in %s on line %d
===DONE===