Skip to content

Segfault in exif_thumbnail when not dealing with a real file #16409

Closed

Description

@YuanchengJiang

Description

The following code:

<?php
$stream = popen('echo 1; echo 2; rm ' . escapeshellarg($tempnam), 'r');
$fusion = proc_open(
'sed "s/^/proc open stdin:/"',
[
0 => $stream,
],
$pipes,
);
exif_thumbnail($stream, $pipes, $stream, $pipes);

PHP Version

nightly

Operating System

ubuntu 22.04

Activity

  1. ndossche commented on Oct 13, 2024

    @ndossche
    Member

    Doesn't reproduce for me, any specific configuration needed?

  2. cmb69 commented on Oct 13, 2024

    @cmb69
    Member

    This might only happen for ZTS builds. However, on NTS builds

    if (VCWD_STAT(stream->orig_path, &st) >= 0) {

    might call stat() with a NULL path.

  3. ndossche commented on Oct 13, 2024

    @ndossche
    Member

    Indeed reproduces on ZTS

  4. self-assigned this
    on Oct 13, 2024
  5. changed the title [-]Segmentation fault in Zend/zend_virtual_cwd.c:1009[/-] [+]Segfault in exif_thumbnail when not dealing with a real file[/+] on Oct 13, 2024
  6. added 4 commits that reference this issue on Oct 13, 2024
    d750697
    3843f0e
    34e635f
    63c9d12
  7. added a commit that references this issue on Oct 13, 2024
    41c55d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions