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 OOB read due to timezone_open() with 5 digit offset #7492

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Contributor

@cmb69 cmb69 commented Sep 14, 2021

This has been reported as bug #78984, and is generally and properly
fixed as of timelib 2020.3 (PHP-8.0). However, it is not fixed in
PHP-7.4, where the test results in an OOB read, and an unterminated
C string when calling ::getName(). Therefore, we apply a minimal
fix which just avoids this dangerous behavior.

This has been reported as bug #78984, and is generally and properly
fixed as of timelib 2020.3 (PHP-8.0).  However, it is not fixed in
PHP-7.4, where the test results in an OOB read, and an unterminated
C string when calling `::getName()`.  Therefore, we apply a minimal
fix which just avoids this dangerous behavior.
@nikic
Copy link
Member

nikic commented Sep 17, 2021

There's this upstream backport: derickr/timelib@8482a89 Maybe this will get pulled in yet?

@cmb69
Copy link
Contributor Author

cmb69 commented Sep 17, 2021

@derickr, what do you think: backport derickr/timelib@8482a89, or only applay this PR for PHP-7.4?

@derickr
Copy link
Contributor

derickr commented Sep 17, 2021

I can't really import that version of timelib, as it changes/adds some features, so the quick fix seems like a good idea. I don't expect to pull in further versions of timelib into 7.4.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

Okay, if no more timelib updates are planned on 7.4, let's go with this!

@cmb69
Copy link
Contributor Author

cmb69 commented Sep 17, 2021

Applied as fac3fbc.

@cmb69 cmb69 closed this Sep 17, 2021
@cmb69 cmb69 deleted the cmb/78984 branch September 17, 2021 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants