Please sign in to comment.
TypedArrays: Fix size/index overflow on 32-bit.
On 64-bit, the calculation is promoted to a 64-bit int. However on 32-bit the int will be 32-bit and the index + size calculation can overflow. Rearrange the math to prevent overflow and add a few more checks for additional safety. The size should never be less than 0, for example, but we check anyway.
- Loading branch information...