diff --git a/lib/buffer.js b/lib/buffer.js index 3f8bb3ca501..2b7134206da 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -529,7 +529,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)