mirror of
https://github.com/php/php-src.git
synced 2024-11-23 09:54:15 +08:00
posix: fix misuse of bool (invalid code in c23)
a bool pointer argument cannot take true or false but either &boolval or NULL Closes GH-10577.
This commit is contained in:
parent
2abb5850ba
commit
ab3f871846
@ -458,7 +458,7 @@ PHP_FUNCTION(posix_ttyname)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) {
|
||||
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) {
|
||||
php_error_docref(NULL, E_WARNING, "Argument #1 ($file_descriptor) must be of type int|resource, %s given",
|
||||
zend_zval_value_name(z_fd));
|
||||
fd = zval_get_long(z_fd);
|
||||
@ -508,7 +508,7 @@ PHP_FUNCTION(posix_isatty)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) {
|
||||
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) {
|
||||
php_error_docref(NULL, E_WARNING, "Argument #1 ($file_descriptor) must be of type int|resource, %s given",
|
||||
zend_zval_value_name(z_fd));
|
||||
fd = zval_get_long(z_fd);
|
||||
@ -1242,7 +1242,7 @@ PHP_FUNCTION(posix_fpathconf)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) {
|
||||
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) {
|
||||
zend_argument_type_error(1, "must be of type int|resource, %s given",
|
||||
zend_zval_value_name(z_fd));
|
||||
RETURN_THROWS();
|
||||
|
Loading…
Reference in New Issue
Block a user