Skip to content

Commit ab3f871

Browse files
crrodriguezdevnexen
authored andcommittedFeb 13, 2023
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.
1 parent 2abb585 commit ab3f871

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎ext/posix/posix.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ PHP_FUNCTION(posix_ttyname)
458458
RETURN_FALSE;
459459
}
460460
} else {
461-
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) {
461+
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) {
462462
php_error_docref(NULL, E_WARNING, "Argument #1 ($file_descriptor) must be of type int|resource, %s given",
463463
zend_zval_value_name(z_fd));
464464
fd = zval_get_long(z_fd);
@@ -508,7 +508,7 @@ PHP_FUNCTION(posix_isatty)
508508
RETURN_FALSE;
509509
}
510510
} else {
511-
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) {
511+
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) {
512512
php_error_docref(NULL, E_WARNING, "Argument #1 ($file_descriptor) must be of type int|resource, %s given",
513513
zend_zval_value_name(z_fd));
514514
fd = zval_get_long(z_fd);
@@ -1242,7 +1242,7 @@ PHP_FUNCTION(posix_fpathconf)
12421242
RETURN_FALSE;
12431243
}
12441244
} else {
1245-
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ false, /* check_null */ false, /* arg_num */ 1)) {
1245+
if (!zend_parse_arg_long(z_fd, &fd, /* is_null */ NULL, /* check_null */ false, /* arg_num */ 1)) {
12461246
zend_argument_type_error(1, "must be of type int|resource, %s given",
12471247
zend_zval_value_name(z_fd));
12481248
RETURN_THROWS();

0 commit comments

Comments
 (0)
Failed to load comments.