From c1118519964e19251db3f26a1484518b7fefc8bc Mon Sep 17 00:00:00 2001 From: gonggy <514592053@qq.com> Date: Sun, 24 Jul 2022 14:14:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DisBase64=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hutool-core/src/main/java/cn/hutool/core/codec/Base64.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java b/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java index 2ffc710c2..249c9e588 100755 --- a/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java +++ b/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java @@ -352,6 +352,9 @@ public class Base64 { * @since 5.7.5 */ public static boolean isBase64(byte[] base64Bytes) { + if (base64Bytes == null || base64Bytes.length < 3) { + return false; + } boolean hasPadding = false; for (byte base64Byte : base64Bytes) { if (hasPadding) {