BUG #73998: Numeric properties are not accessible from get_object_vars#2354
Closed
mhagstrand wants to merge 1 commit intophp:PHP-7.0from
Closed
BUG #73998: Numeric properties are not accessible from get_object_vars#2354mhagstrand wants to merge 1 commit intophp:PHP-7.0from
mhagstrand wants to merge 1 commit intophp:PHP-7.0from
Conversation
Contributor
Author
|
get_object_vars hashes the numeric string when exporting it the symbols table In the symbols table numeric strings are not hashed, There numeric value is used as the hash value: |
Contributor
Author
|
It is causing a segfault in |
Contributor
Author
|
Fixed the issue with |
nikic
reviewed
Jan 31, 2017
Zend/zend_builtin_functions.c
Outdated
| fast_copy = 1; | ||
| /* Check if the object has a numeric property, See Bug 73998 */ | ||
| ZEND_HASH_FOREACH_STR_KEY(properties, key) { | ||
| if (ZEND_HANDLE_NUMERIC(key, index)) { |
Member
There was a problem hiding this comment.
This has to check that key is non-null.
Contributor
Author
|
Thanks, I have added a check to make sure the key is not null. |
staabm
reviewed
Jan 31, 2017
Zend/zend_builtin_functions.c
Outdated
| } | ||
|
|
||
| if (fast_copy) { | ||
| /* fast copy */ |
Contributor
Author
There was a problem hiding this comment.
Absolutely, I will remove it.
nikic
reviewed
Feb 2, 2017
| @@ -0,0 +1,19 @@ | |||
| --TEST-- | |||
| Bug #35239 (array_key_exists fails on arrays created by get_object_vars) | |||
Contributor
Author
There was a problem hiding this comment.
Yeah, I copied another test as a basic template! 😄 Thanks for catching that.
Member
|
Merged via dd9cf23, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.