Fix bug #79783: segfault in str_replace()#5811
Closed
MaxSem wants to merge 1 commit intophp:masterfrom
Closed
Conversation
This change addresses one of two problems: that this function crashes when passed anything but a reference as a 4th parameter. Another problem is that it's possible to trick PHP into passing a non-reference with defined(), but it will be addressed separately. The solution in this change is applicable to other functions, they will be upgraded later.
nikic
requested changes
Jul 5, 2020
Member
nikic
left a comment
There was a problem hiding this comment.
str_replace declares that the argument is passed by reference, as such it may assume that it always receives a reference. If it does not, then that's a bug in the calling code, not str_replace.
Member
|
The underlying issue should be addressed by 971e5c5. |
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.
This change addresses one of two problems: that this function
crashes when passed anything but a reference as a 4th parameter.
Another problem is that it's possible to trick PHP into passing a
non-reference with defined(), but it will be addressed separately.
The solution in this change is applicable to other functions, they
will be upgraded later.