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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
14
ext/exif/tests/bug76409.phpt
Normal file
14
ext/exif/tests/bug76409.phpt
Normal 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===
|
||||
Reference in New Issue
Block a user