From: Jesse Tane Date: Thu, 18 Dec 2014 05:50:17 +0000 (-0500) Subject: fix broken max-length check X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=e39e518b54f83c5dcc322523d347b70f76402793;p=buffer.git fix broken max-length check --- diff --git a/index.js b/index.js index 2637df0..baeb4ff 100644 --- a/index.js +++ b/index.js @@ -85,7 +85,7 @@ function Buffer (subject, encoding, noZero) { } else throw new TypeError('must start with number, buffer, array or string') - if (this.length > kMaxLength) + if (length > kMaxLength) throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength.toString(16) + ' bytes')