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:
Tyson Andre 2021-06-13 16:04:37 -04:00 committed by GitHub
parent 4633a90202
commit 9a0cc69c53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}