-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Issue 43177 #98
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
Closed
Closed
Issue 43177 #98
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a65037e
If an eval() has a parse error, the overall exit status and return
truthptn 87b5158
Merge remote branch 'upstream/master' into issue-43177
03f4804
Making sure opline exists and opcode is ZEND_INCLUDE_OR_EVAL before
79ebc24
Also need to confirm current_execute_data is non-null
5cdb988
Moving variable definition to start of code block.
511cb36
Merge remote branch 'upstream/master' into issue-43177
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
Not sure this is safe - what guarantees that EG(current_execute_data)->opline is valid for every call to zend_error?
For example, this segfaults: php -r '0+'
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.
Also I'm not sure whether just checking the extended value is safe.
ZEND_EVAL
is1
and I imagine that this extended value is also used for other opcodes in other circumstances. So you should probably additionally check that the opcode isZEND_INCLUDE_OR_EVAL
.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.
Glad someone who knows how internals works looked at this! I've updated the code to check for the existence of everything being used before using it. In main.c, I introduced a local boolean. I guessed the type should be "zend_bool", but that was just a guess.
php -r '0+' no longer segfaults. Bad evals are harmless. Other parse errors are fatal (but don't segfault).