From e104540471509f547301591b9842eaede341b952 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 16 Feb 2018 00:58:28 -0800 Subject: [PATCH] Buffer.isBuffer(Buffer.prototype) should be false --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f47a36a..4acc3d1 100644 --- a/index.js +++ b/index.js @@ -329,7 +329,8 @@ function SlowBuffer (length) { } Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { -- 2.34.1