Closed
Conversation
nikic
reviewed
Dec 14, 2018
ext/sodium/libsodium.c
Outdated
| zval *args = zend_hash_str_find(Z_ARRVAL_P(frame), "args", sizeof("args")-1); | ||
| if (args && Z_TYPE_P(frame) == IS_ARRAY) { | ||
| if (args != NULL && Z_TYPE_P(args) == IS_ARRAY && | ||
| Z_REFCOUNTED_P(args) && Z_REFCOUNT_P(args) == 1) { |
Member
There was a problem hiding this comment.
As the intention here is to hide arguments, this check would kinda defeat the point in the cases where it triggers. As an alternative, I'd suggest doing something like
zval *args = zend_hash_str_find(Z_ARRVAL_P(frame), "args", sizeof("args")-1);
zval_ptr_dtor(args);
ZVAL_EMPTY_ARRAY(args);
in order to overwrite with an empty array, without corrupting the original one.
Member
|
Could you please also add a test file, to avoid regressing this in the future? |
Contributor
Author
|
Yep! :) |
Contributor
Author
|
I have no idea what's going on with the Windows build here, but it seems wholly unrelated to the libsodium change. |
nikic
approved these changes
Dec 15, 2018
Member
nikic
left a comment
There was a problem hiding this comment.
AppVeyor failure is intermittent.
Member
|
Thanks! Applied as e0e08d3. |
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.
https://bugs.php.net/bug.php?id=77297
jedisct1/libsodium-php@736b7d1