mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-16769: php_pcntl_set_user_signal_infos aborts when a signal is a reference.
close GH-16772
This commit is contained in:
4
NEWS
4
NEWS
@@ -14,6 +14,10 @@ PHP NEWS
|
||||
- Hash:
|
||||
. Fixed GH-16711: Segfault in mhash(). (Girgias)
|
||||
|
||||
- PCNTL:
|
||||
. Fixed bug GH-16769: (pcntl_sigwaitinfo aborts on signal value
|
||||
as reference). (David Carlier)
|
||||
|
||||
- PDO:
|
||||
. Fixed memory leak of `setFetchMode()`. (SakiTakamachi)
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
18
ext/pcntl/tests/gh16769.phpt
Normal file
18
ext/pcntl/tests/gh16769.phpt
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user