-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Revert the earlier TypedArray change as it may lead to integer overflow. #2350
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
Revert the earlier TypedArray change as it may lead to integer overflow. #2350
Conversation
|
@Microsoft/chakra-developers |
lib/Runtime/Library/TypedArray.cpp
Outdated
| newByteLength = mappedLength * elementSize; | ||
|
|
||
| if (offset + newByteLength > byteLength) | ||
| if ((uint32)mappedLength > (byteLength - offset)/ elementSize) |
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.
In the above ToIndex call you could pass (byteLength - offset)/ elementSize instead of ArrayBuffer::MaxArrayBufferLength / elementSize. That should be same, right?
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.
Yes. I will make that change.
|
Looks good, please get Akrosh's signoff as well. |
|
|
…ay lead to integer overflow. Merge pull request #2350 from atulkatti:TypedArray.Bug10450472
…hange as it may lead to integer overflow. Merge pull request #2350 from atulkatti:TypedArray.Bug10450472
|
What was the earlier change? Can you please link to the PR number? |
No description provided.