-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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 unsafe cast and detect resize overflow. #31106
Conversation
|
Base commit: 00959ff |
Base commit: 00959ff |
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.
@rozele 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.
@rozele has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Recent changes to `MapBuffer` have broken the compilation on Windows. This fix is similar to this recently-merged change: #31106 Side note - this PR only addresses a build break, but doesn't address the unsafe casting semantics in `MapBuffer`, which can still cause overflows. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Fix compilation errors on Windows. Pull Request resolved: #31363 Test Plan: RN now builds in Visual Studio on Windows. Reviewed By: mdvacca Differential Revision: D28028342 Pulled By: rozele fbshipit-source-id: 77d8d4870c59b77acfc0ab2f4c3b7df40b59851d
Summary
Removing unsafe cast from
int
touint16_t
.Also, adding code to detect multiplication overflow during buffer resize.
Changelog
[General] [Fix] - Fix unsafe cast and detect overflow in MapBuffer.
Test Plan
Code compiles in Visual Studio 2019 without the unsafe cast warning (or error depending on the configuration).