-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix use-after-free during lazy object initialization #16004
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
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.
Suggest adding a test case with the reproduction case from my report in #15999
Indeed, I forgot to stage the test :) |
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!
Zend/zend_object_handlers.c
Outdated
@@ -1184,12 +1184,22 @@ found:; | |||
return variable_ptr; | |||
|
|||
lazy_init: |
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.
Nit: Usually, the restriction to declare a variable after a label is circumvented with a ;
.
lazy_init: | |
lazy_init:; |
If you prefer braces, that's fine too.
Fixes two issues discovered by #15999: