Skip to content

Remove dead error checks for php_stream_filter_alloc() #19194

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

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

nielsdos
Copy link
Member

php_stream_filter_alloc() can't fail, so simplify the code.

php_stream_filter_alloc() can't fail, so simplify the code.
@nielsdos nielsdos merged commit 841f0b1 into php:master Aug 12, 2025
9 checks passed
@bukka
Copy link
Member

bukka commented Aug 12, 2025

@nielsdos I can see the code is not ready for malloc fail (so it would segfault) but shouldn't we rather add malloc failure check and keep the NULL checks? Or can it not be persistent (I haven't checked that part)?

@nielsdos
Copy link
Member Author

@nielsdos I can see the code is not ready for malloc fail (so it would segfault)

That's false, you're looking at the debug code rather than the release code.

@bukka
Copy link
Member

bukka commented Aug 12, 2025

Ah yeah it's __zend_malloc for non ZEND_DEBUG. It's a bit strange though that the debug version can fail and potentially segfault. What's the actual reason of not using __zend_malloc in debug build?

@nielsdos
Copy link
Member Author

nielsdos commented Aug 13, 2025

Likely an oversight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants