Skip to content

Commit 53e5c09

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 7b029a3 + b8115d6 commit 53e5c09

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

ext/pcntl/pcntl.c

+1
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ static bool php_pcntl_set_user_signal_infos(
874874
zval *user_signal_no;
875875
ZEND_HASH_FOREACH_VAL(user_signals, user_signal_no) {
876876
bool failed = true;
877+
ZVAL_DEREF(user_signal_no);
877878
zend_long tmp = zval_try_get_long(user_signal_no, &failed);
878879

879880
if (failed) {

ext/pcntl/tests/gh16769.phpt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
pcntl_sigwaitinfo abort when signals is an array with self-reference.
3+
--EXTENSIONS--
4+
pcntl
5+
--SKIPIF--
6+
<?php if (!function_exists("pcntl_sigwaitinfo")) die("skip pcntl_sigwaitinfo() not available"); ?>
7+
--FILE--
8+
<?php
9+
$a[0] = &$a;
10+
11+
try {
12+
pcntl_sigwaitinfo($a,$a);
13+
} catch(\TypeError $e) {
14+
echo $e->getMessage();
15+
}
16+
?>
17+
--EXPECT--
18+
pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be of type int, array given

0 commit comments

Comments
 (0)