mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Use 16 instead of 15 bytes of random data in ReflectionReference->getId (#7148)
``` ZEND_BEGIN_MODULE_GLOBALS(reflection) bool key_initialized; unsigned char key[REFLECTION_KEY_LEN]; ZEND_END_MODULE_GLOBALS(reflection) ``` This was previously also overwriting key_initialized, which didn't matter at all because C struct layout is always in order of declaration and the value of key_initialized was subsequently set to 1.
This commit is contained in:
parent
4633a90202
commit
9a0cc69c53
1 changed files with 1 additions and 1 deletions
|
@ -6370,7 +6370,7 @@ ZEND_METHOD(ReflectionReference, getId)
|
|||
}
|
||||
|
||||
if (!REFLECTION_G(key_initialized)) {
|
||||
if (php_random_bytes_throw(&REFLECTION_G(key_initialized), 16) == FAILURE) {
|
||||
if (php_random_bytes_throw(&REFLECTION_G(key), 16) == FAILURE) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue