Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/parallel/test-buffer-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ read(buf, 'readUIntBE', [2, 0], 0xfd);
read(buf, 'readUIntLE', [2, 0], 0x48);

// attempt to overflow buffers, similar to previous bug in array buffers
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(0xffffffff),
assert.throws(() => Buffer.allocUnsafe(8).readFloatBE(0xffffffff),
RangeError);
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(0xffffffff),
RangeError);

// ensure negative values can't get past offset
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(-1), RangeError);
assert.throws(() => Buffer.allocUnsafe(8).readFloatBE(-1), RangeError);
assert.throws(() => Buffer.allocUnsafe(8).readFloatLE(-1), RangeError);

// offset checks
Expand Down