Skip to content

ext/date: null bytes in timezones can only happen via HT initialization #19357

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 6, 2025

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Aug 3, 2025

In which case we don't use the warning_message anyway

@Girgias Girgias marked this pull request as ready for review August 3, 2025 22:25
@Girgias Girgias requested a review from derickr as a code owner August 3, 2025 22:25
@Girgias Girgias requested a review from nielsdos August 5, 2025 11:53
if (warning_message) {
spprintf(warning_message, 0, "Timezone must not contain null bytes");
}
if (UNEXPECTED(zend_str_has_nul_byte(tz_zstr))) {
Copy link
Member

Choose a reason for hiding this comment

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

The cleaner, and faster, approach is to move this check simply to php_date_timezone_initialize_from_hash IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, wasn't sure if I should move it up or not.

In which case we don't use the warning_message anyway
@Girgias Girgias merged commit aa9694b into php:master Aug 6, 2025
9 checks passed
@Girgias Girgias deleted the date-drop-check branch August 6, 2025 20:02
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