Fix #79491: Search for .user.ini extends up to root dir#5417
Closed
cmb69 wants to merge 1 commit intophp:PHP-7.3from
Closed
Fix #79491: Search for .user.ini extends up to root dir#5417cmb69 wants to merge 1 commit intophp:PHP-7.3from
cmb69 wants to merge 1 commit intophp:PHP-7.3from
Conversation
The `start` parameter of `php_cgi_ini_activate_user_config` is supposed to hold the byte offset of the doc root in the given `path`. However, the current expression which fixes a potential type incompatibility will ever only evaluate to zero or one, because it uses the *logical* and operator (`&&`). Furthermore we notice that subtracting one from `doc_root_len` is not necessary, so there is even no need for the `start` parameter at all.
nikic
approved these changes
Apr 20, 2020
php-pulls
pushed a commit
that referenced
this pull request
Apr 20, 2020
This is the change from GH-5417 but for FPM. This was stripping the last character from the doc_root. Given how it is used, this should be harmless, but let's make it less confusing...
Member
|
I've applied f62571c to the FPM code. |
Member
Author
|
Thanks! Applied as fa10abd. |
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.
The
startparameter ofphp_cgi_ini_activate_user_configis supposedto hold the byte offset of the doc root in the given
path. However,the current expression which fixes a potential type incompatibility
will ever only evaluate to zero or one, because it uses the logical
and operator (
&&). Furthermore we notice that subtracting one fromdoc_root_lenis not necessary, so there is even no need for thestartparameter at all.Someone working on Linux may want to review the respective code in fpm_main.c; passing
doc_root_len - 1seems equally superfluous there. Contrary to the code in cgi_main.c, that doesn't look like a real bug, though.