summaryrefslogtreecommitdiff
path: root/lib/buffer.js
diff options
context:
space:
mode:
authorƁukasz Walukiewicz <lukasz@walukiewicz.eu>2013-04-05 16:48:18 +0200
committerisaacs <i@izs.me>2013-04-08 16:17:38 -0700
commit2e28832660099b49d861f4d4039d8d35ebb6c77e (patch)
tree8a5d9a7ed4ab8016807f1df89a7686148647a7c0 /lib/buffer.js
parentc93af860a079654becb3b1d06184ab7428dedffb (diff)
downloadnode-new-2e28832660099b49d861f4d4039d8d35ebb6c77e.tar.gz
buffer: fix offset checks
Fixed offset checks in Buffer.readInt32LE() and Buffer.readInt32BE() functions.
Diffstat (limited to 'lib/buffer.js')
-rw-r--r--lib/buffer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/buffer.js b/lib/buffer.js
index 3378dcebfc..c75dbc93a8 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -737,14 +737,14 @@ function readInt32(buffer, offset, isBigEndian) {
Buffer.prototype.readInt32LE = function(offset, noAssert) {
if (!noAssert)
- checkOffset(offset, 2, this.length);
+ checkOffset(offset, 4, this.length);
return readInt32(this, offset, false);
};
Buffer.prototype.readInt32BE = function(offset, noAssert) {
if (!noAssert)
- checkOffset(offset, 2, this.length);
+ checkOffset(offset, 4, this.length);
return readInt32(this, offset, true);
};