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

[iOS] Fixes NSDataBigString length calculation #44900

Closed

Conversation

zhongwuzw
Copy link
Contributor

@zhongwuzw zhongwuzw commented Jun 12, 2024

Summary:

We assume data[length] is '\0', like Android

. So we should minus 1 after we called ensureNullTerminated. it may crash in hermes engine because hermes should ensure data[length] is \0.

Changelog:

[IOS] [FIXED] - Fixes NSDataBigString length calculation

Test Plan:

We can mimic the crash by changes some code :
image

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jun 12, 2024
@facebook-github-bot
Copy link
Contributor

@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 14, 2024
@facebook-github-bot
Copy link
Contributor

@NickGerleman merged this pull request in 9d637e4.

Copy link

This pull request was successfully merged by @zhongwuzw in 9d637e4.

When will my fix make it into a release? | How to file a pick request?

realsoelynn added a commit to realsoelynn/react-native that referenced this pull request Aug 14, 2024
Summary:
Pull Request resolved: facebook#46011

Backing out D58561775 in the meantime while we are trying to do proper fix in Hermes engine D61058869

Changelog: [Internal]
Temporarily revert this diff facebook#44900 while we wait for facebook#45966 to land

Differential Revision: D61246120
facebook-github-bot pushed a commit that referenced this pull request Aug 14, 2024
Summary:
Pull Request resolved: #46011

Backing out D58561775 in the meantime while we are trying to do proper fix in Hermes engine D61058869

Changelog: [Internal]
Temporarily revert this diff #44900 while we wait for #45966 to land

Reviewed By: makovkastar

Differential Revision: D61246120

fbshipit-source-id: 8c205efe9d29cd34f24676c4a48d55f0493d73ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants