diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/buffer.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/buffer.js b/lib/buffer.js index cd08453c24..03f0cb3377 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -1040,8 +1040,10 @@ Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { offset = offset >>> 0; byteLength = byteLength >>> 0; - if (!noAssert) + if (!noAssert) { + checkByteLength(byteLength); checkOffset(offset, byteLength, this.length); + } var val = this[offset]; var mul = 1; @@ -1057,8 +1059,10 @@ Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { offset = offset >>> 0; byteLength = byteLength >>> 0; - if (!noAssert) + if (!noAssert) { + checkByteLength(byteLength); checkOffset(offset, byteLength, this.length); + } var val = this[offset + --byteLength]; var mul = 1; |