-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Replace memcmp() with zend_string functions #8216
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
Conversation
This PR is doing too much and unrelated things, can you please split them up into related PRs. Also IMHO adding and using a newly introduced API should be two different commits. |
e437b4b
to
993265c
Compare
@Girgias better? |
LGTM, but I don't know what our policy is about adding new APIs |
993265c
to
77b0558
Compare
Thanks @nikic and @Girgias for the reviews. I rebased and force-pushed with these changes:
Does that meet your change requests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Eliminate duplicate code.
Eliminate duplicate code.
Allows eliminating duplicate code.
Eliminate duplicate code.
This adds missing length checks to several callers, e.g. in cache_script_in_shared_memory(). This is important when the zend_string is shorter than the string parameter, when memcmp() happens to check backwards; this can result in an out-of-bounds memory access.
77b0558
to
3795de2
Compare
Curious question - @iluuu1994 you folded all commits of this PR into one - why? I took extra care to submit separate commits for separate aspects, to make my work easier to read & review, and to allow bisecting in case of bugs found later. Folding all comits breaks that. |
https://wiki.php.net/vcs/gitworkflow
Your commit history is clean but often that's not the case and it makes more sense to squash. I guess in this case either would've been fine. |
No description provided.