Fix #79491: Search for .user.ini extends up to root dir #5417
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
start
parameter ofphp_cgi_ini_activate_user_config
is 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_len
is not necessary, so there is even no need for thestart
parameter at all.Someone working on Linux may want to review the respective code in fpm_main.c; passing
doc_root_len - 1
seems equally superfluous there. Contrary to the code in cgi_main.c, that doesn't look like a real bug, though.