Skip to content

SEGV SplTempFileObject getPathInfo #17516

Closed

Description

@YuanchengJiang

Description

The following code:

<?php
$cls = new SplTempFileObject();
trait T1 { function m1() { } function m2() { } }
class C4 { use T1 { m1 as a1; m2 as a2; } }
$classes  = ['C1', 'C2', 'C3', 'C4'];
foreach ($classes as $c) {
}
$cls->getPathInfo($c);

Resulted in this output:

/home/phpfuzz/WorkSpace/flowfusion/php-src/ext/spl/spl_directory.c:487:23: runtime error: member access within null pointer of type 'zend_function' (aka 'union _zend_function')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/spl/spl_directory.c:487:23

PHP Version

nightly

Operating System

No response

Activity

  1. devnexen commented on Jan 19, 2025

    @devnexen
    Member

    Reproducible only from 8.4 and onwards. Seems the commit in question is 90b8db4

  2. self-assigned this
    on Jan 19, 2025
  3. added a commit that references this issue on Jan 19, 2025
    c82e31b
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