Skip to content

Commit 20586e0

Browse files
committed
Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
1 parent 1d0fbdf commit 20586e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/exif/exif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4419,7 +4419,7 @@ static bool exif_read_from_impl(image_info_type *ImageInfo, php_stream *stream,
44194419
ImageInfo->FileName = NULL;
44204420

44214421
if (php_stream_is(ImageInfo->infile, PHP_STREAM_IS_STDIO)) {
4422-
if (VCWD_STAT(stream->orig_path, &st) >= 0) {
4422+
if (stream->orig_path && VCWD_STAT(stream->orig_path, &st) >= 0) {
44234423
zend_string *base;
44244424
if ((st.st_mode & S_IFMT) != S_IFREG) {
44254425
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Not a file");

0 commit comments

Comments
 (0)