Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 16 instead of 15 bytes of random data in ReflectionReference->getId #7148

Merged
merged 1 commit into from Jun 13, 2021

Conversation

TysonAndre
Copy link
Contributor

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 (I think?)
because C struct layout is always in order of declaration and the value of
key_initialized was subsequently set to 1.

Amends 6347f0b added in php 7.4

```
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.
@TysonAndre TysonAndre requested a review from nikic June 13, 2021 19:35
Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops

@TysonAndre TysonAndre merged commit 9a0cc69 into php:master Jun 13, 2021
krakjoe added a commit that referenced this pull request Jun 13, 2021
* 'master' of github.com:php/php-src:
  Use 16 instead of 15 bytes of random data in ReflectionReference->getId (#7148)
  Fix test wrt. OPENSSL_CONF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants