-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix GH-20286: use-after-destroy during userland stream_close(). #20348
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
Zend/zend_execute_API.c
Outdated
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.
Please use an early return.
7157f48 to
6cada70
Compare
Zend/zend_execute_API.c
Outdated
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.
Should be #if rather than #ifdef, ZEND_DEBUG always declared in main/php_config.h but may be 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.
There should probably be a ZVAL_UNDEF(retval); as below.
6cada70 to
d354d83
Compare
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.
This looks a bit odd, why is this necessary?
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.
Program received signal SIGSEGV, Segmentation fault. 0x0000555555aa0f35 in _php_stream_free (stream=<optimized out>, close_options=close_options@entry=11) at /home/dcarlier/Contribs/php-src/main/streams/streams.c:505 505 stream->wrapper->wops->stream_closer(stream->wrapper, stream); (gdb) p *stream->wrapper->wops 2ドル = {stream_opener = 0x7ffff767be60, stream_closer = 0xc0d29af9ee47b9cc, stream_stat = 0xb, url_stat = 0x735f6d6165727473, dir_opener = 0x6f69747000746174, label = 0x6e <error: Cannot access memory at address 0x6e>, unlink = 0x0, rename = 0x5555568bc500, stream_mkdir = 0x0, stream_rmdir = 0x5a0, stream_metadata = 0x7ffff767beb0} (gdb) p *stream->wrapper->wops->stream_closer Cannot access memory at address 0xc0d29af9ee47b9cc (gdb)
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.
Can you indent by 4 spaces?
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.
Maybe create the $context prop and create empty stubs for these functions to make the warnings go away.
No description provided.