]> zoso.dev Git - buffer.git/commitdiff
fix broken max-length check
authorJesse Tane <jesse.tane@gmail.com>
Thu, 18 Dec 2014 05:50:17 +0000 (00:50 -0500)
committerJesse Tane <jesse.tane@gmail.com>
Mon, 22 Dec 2014 22:44:15 +0000 (17:44 -0500)
index.js

index 2637df0fc23d753c7bfd8441a69f8edd1f120d0a..baeb4ff00da051785323d6f1fc197688851d627b 100644 (file)
--- 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')