mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
ext/posix: posix_isatty() fix use-of-uninitialized-value (#11676)
When the value passed is not representable as an int then it is not a TTY and thus should return false immediately. This was reported by MSAN.
This commit is contained in:
parent
b79d988d38
commit
59f6d08f83
2 changed files with 1 additions and 5 deletions
|
@ -516,7 +516,7 @@ PHP_FUNCTION(posix_isatty)
|
|||
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);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,13 +58,9 @@ Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|reso
|
|||
bool(false)
|
||||
class:
|
||||
Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|resource, stdClass given in %s on line %d
|
||||
|
||||
Warning: Object of class stdClass could not be converted to int in %s on line %d
|
||||
bool(false)
|
||||
stringable class:
|
||||
Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|resource, classWithToString given in %s on line %d
|
||||
|
||||
Warning: Object of class classWithToString could not be converted to int in %s on line %d
|
||||
bool(false)
|
||||
int castable class:
|
||||
Warning: posix_isatty(): Argument #1 ($file_descriptor) must be of type int|resource, GMP given in %s on line %d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue