Skip to content
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

Fix GH-17400: bindtextdomain segfault with UTF-16 domain value. #17402

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Jan 8, 2025

The provided domain could be a non ascii value even if not supposed to, in the error reported case was of 4 code points long but domain is "empty" leading to a NULL return. It worked up to 8.3 "by accident" before the zend_string conversion and check prior for emptiness.

@devnexen devnexen linked an issue Jan 8, 2025 that may be closed by this pull request
ext/gettext/gettext.c Outdated Show resolved Hide resolved
@devnexen devnexen marked this pull request as ready for review January 9, 2025 04:39
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Besides the test title, this looks good to me.

ext/gettext/tests/gh17400.phpt Outdated Show resolved Hide resolved
The provided domain could be a non ascii value even if not supposed to,
in the error reported case was of 4 code points long but domain is "empty" leading to
a NULL return. It worked up to 8.3 "by accident" before the zend_string
conversion and check prior for emptiness.
@devnexen devnexen closed this in e975c27 Jan 9, 2025
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.

SEGV in bindtextdomain
2 participants