mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:47:45 +00:00
LibJS: Add overflow checks when creating TypedArray from ArrayBuffer
Thanks to Iliad for finding this! :^)
This commit is contained in:
parent
c899ace3ad
commit
f6c6047e49
2 changed files with 28 additions and 7 deletions
|
@ -0,0 +1,5 @@
|
|||
test("construct Uint32Array with zero-length ArrayBuffer and overflowing offset", () => {
|
||||
expect(() => new Uint32Array(new ArrayBuffer(0), 4, 1024 * 1024 * 1024 - 1)).toThrow(
|
||||
RangeError
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue