Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/pcntl/pcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ static bool php_pcntl_set_user_signal_infos(
zval *user_signal_no;
ZEND_HASH_FOREACH_VAL(user_signals, user_signal_no) {
bool failed = true;
ZVAL_DEREF(user_signal_no);
zend_long tmp = zval_try_get_long(user_signal_no, &failed);

if (failed) {
Expand Down
18 changes: 18 additions & 0 deletions ext/pcntl/tests/gh16769.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
pcntl_sigwaitinfo abort when signals is an array with self-reference.
--EXTENSIONS--
pcntl
--SKIPIF--
<?php if (!function_exists("pcntl_sigwaitinfo")) die("skip pcntl_sigwaitinfo() not available"); ?>
--FILE--
<?php
$a[0] = &$a;

try {
pcntl_sigwaitinfo($a,$a);
} catch(\TypeError $e) {
echo $e->getMessage();
}
?>
--EXPECT--
pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be of type int, array given
Loading