[php-src] PR #11694: Fix use-of-uninitialized-value when calling php_posix_stream_get_fd
| From: | iluuu1994 | Date: | Thu, 13 Jul 2023 08:25:54 +0000 |
| Subject: | [php-src] PR #11694: Fix use-of-uninitialized-value when calling php_posix_stream_get_fd | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23023@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11694
Author: iluuu1994
Passing a double pointer to php_stream_cast means the caller of php_posix_stream_get_fd will never
receive the actual value. Moreover, php_posix_stream_get_fd may only write the low
sizeof(php_socket_t) bytes of fd, so we need to initialize the upper bytes to 0 to avoid partial
use-of-uninitialized-value.
The
(void*)&fd typo tells me that the tests aren't actually testing much.
:smirk: