Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

preg_replace_callback_array segmentation fault #10968

Closed
@voidptr127

Description

@voidptr127

Description

The following code:

<?php$a = [];$a =preg_replace_callback_array($a,$a,$b,$b)?>

Resulted in this output:

Warning: Undefined variable $b in Standard input code on line 3Deprecated: preg_replace_callback_array(): Passing null to parameter #3 ($limit) of type int is deprecated in Standard input code on line 3Segmentation fault (core dumped)

But I expected something like this output instead (I am not sure about the null values. At the very least I would not expect a segmentation fault.):

[rocky@fuzz php-src]$ cat <<'EOF' | ~/php-src/sapi/cli/php<?php$a = []; $a = preg_replace_callback_array($a,$a,null,null)?>EOFFatal error: Uncaught Error: preg_replace_callback_array(): Argument #4 ($count) cannot be passed by reference in Standard input code:3Stack trace:#0 {main}  thrown in Standard input code on line 3

How to compile:

./buildconf --force./configure --disable-all --enable-debug-assertions --enable-option-checking=fatal --without-pcre-jit --disable-cgi --with-picmake -j$(nproc)

PHP Version

php-8.2.4RC1

Operating System

Rocky Linux release 9.1 (Blue Onyx)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp