-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Fix crash when calling substring() on a string containing emoji. #23609
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdvacca has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdvacca has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@ericlewis I followed up on the imported diff and it looks like David is seeking additional review from some fellow team members. No action needed on your part for now. Thanks for the PR! |
@ericlewis the PR is approved, I tried to land this but got conflicts on the png. can you rebase it? I will land it after. Thanks |
@mdvacca done! (tho I seem to have messed up the history a bit 🤔) |
@ericlewis yeah it seems like the PR was messed up. Could you rebase on top of master and force push to your branch with only the changes you made? |
@cpojer fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdvacca is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @ericlewis in 58c3a4c. When will my fix make it into a release? | Upcoming Releases |
) Summary: Fixes #23459. It is not legal to write the character array of a std::string, and can result in undefined behavior. [General] [Fixed] - Crash when substring intersects with emoji Pull Request resolved: #23609 Differential Revision: D14198159 Pulled By: mdvacca fbshipit-source-id: 71060b1b99ddab89793c98c09f99ec9974479e62
Summary
Fixes #23459. It is not legal to write the character array of a std::string, and can result in undefined behavior.
Changelog
[General] [Fixed] - Crash when substring intersects with emoji
Test Plan
Updated RNTester
TextExample.ios.js & TextExample.android.js
with a section containing the below:Also updated the test snapshot for iOS. So long as it doesn't crash tho, the test technically is passed.