mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
This commit is contained in:
4
NEWS
4
NEWS
@@ -18,6 +18,10 @@ PHP NEWS
|
||||
(nielsdos)
|
||||
. Add missing hierarchy checks to replaceChild. (nielsdos)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug GH-16409 (Segfault in exif_thumbnail when not dealing with a
|
||||
real file). (nielsdos, cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug GH-16334 (imageaffine overflow on matrix elements).
|
||||
(David Carlier)
|
||||
|
||||
@@ -4399,7 +4399,7 @@ static bool exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream,
|
||||
ImageInfo->FileName = NULL;
|
||||
|
||||
if (php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) {
|
||||
if (VCWD_STAT(stream->orig_path, &st) >= 0) {
|
||||
if (stream->orig_path && VCWD_STAT(stream->orig_path, &st) >= 0) {
|
||||
zend_string *base;
|
||||
if ((st.st_mode & S_IFMT) != S_IFREG) {
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Not a file");
|
||||
|
||||
12
ext/exif/tests/gh16409.phpt
Normal file
12
ext/exif/tests/gh16409.phpt
Normal file
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
GH-16409 (Segfault in exif_thumbnail when not dealing with a real file)
|
||||
--EXTENSIONS--
|
||||
exif
|
||||
--FILE--
|
||||
<?php
|
||||
$stream = popen('echo 1', 'r');
|
||||
var_dump(exif_thumbnail($stream, $pipes, $stream, $pipes));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_thumbnail(): File too small (0) in %s on line %d
|
||||
bool(false)%A
|
||||
Reference in New Issue
Block a user