Skip to content

ext/standard: Release lc_needle on OOM in php_str_to_str_i_ex() - #25848

Closed
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/str-ireplace-oom-leak-84
Closed

iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/str-ireplace-oom-leak-84

Conversation

@iliaal

@iliaal iliaal commented Nov 27, 2026

Copy link
Copy Markdown
Member

If zend_string_safe_falloc() fails under memory_limit, the early return in php_str_to_str_i_ex() leaks the lowercased needle.

When zend_string_safe_falloc() fails under memory_limit,
php_str_to_str_i_ex() returned NULL without releasing the lowercased needle.

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Correct of course, though I suppose this doesn't really matter in practice

@iliaal iliaal closed this in 8096dc6 Nov 28, 2026
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.

2 participants