From c43f22363b84943d13f02a546c21d256cdf477ad Mon Sep 17 00:00:00 2001 From: Khaidi Chu Date: Thu, 28 Jul 2022 16:16:15 +0800 Subject: [PATCH] Update lib/buffer.js Co-authored-by: Antoine du Hamel --- lib/buffer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/buffer.js b/lib/buffer.js index b9e2fc9b2253bf..bbb393b94c844c 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -1280,7 +1280,7 @@ function atob(input) { // ASCII whitespace char codes. nonAsciiWhitespaceCharCount++; - if (index === kForgivingBase64AllowedChars.length - 1) { + if (index === kForgivingBase64AllowedChars.length - 1 && equalCharCount !== 2) { // The last element of `kForgivingBase64AllowedChars` is the `=` equalCharCount++; } else if (equalCharCount) {