diff --git a/lib/buffer.js b/lib/buffer.js index f43ec7acd86..876bdbe1cfd 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -539,7 +539,7 @@ Buffer.prototype.compare = function compare(target, if (start === undefined) start = 0; if (end === undefined) - end = target ? target.length : 0; + end = target.length; if (thisStart === undefined) thisStart = 0; if (thisEnd === undefined)