Skip to content

zlib: use zend_string_{extend,truncate} over *_realloc #18462

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
Apr 30, 2025

Conversation

morrisonlevi
Copy link
Contributor

These cases seemed obvious enough to me to confidently change as an outsider. There are a few more cases of zend_string_realloc still in other parts of the engine.

Note that deflate_add is possibly missing a zend_string_truncate step at the end of it, similar to what inflate_add has. Or alternatively inflate_add is doing an unnecessary zend_string_truncate. They don't match, in any case.

These cases seemed obvious enough to me to confidently change as an
outsider. There are a few more cases of zend_string_realloc still.
Copy link
Member

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right to me.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@morrisonlevi morrisonlevi merged commit 6406d5f into php:master Apr 30, 2025
9 checks passed
@morrisonlevi morrisonlevi deleted the realloc branch April 30, 2025 14:18
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