This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit c56b95664913aab406f768c66f9264481b28c1bb Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Apr 20 13:48:12 2024 -0400 Bullet-proof internals --- src/main/java/org/apache/commons/codec/binary/Base16.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/apache/commons/codec/binary/Base16.java b/src/main/java/org/apache/commons/codec/binary/Base16.java index 65f75c42..c3dfe818 100644 --- a/src/main/java/org/apache/commons/codec/binary/Base16.java +++ b/src/main/java/org/apache/commons/codec/binary/Base16.java @@ -17,6 +17,8 @@ package org.apache.commons.codec.binary; +import java.util.Objects; + import org.apache.commons.codec.CodecPolicy; /** @@ -138,6 +140,7 @@ public class Base16 extends BaseNCodec { */ private Base16(final boolean lowerCase, final byte[] encodeTable, final CodecPolicy decodingPolicy) { super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK, 0, 0, PAD_DEFAULT, decodingPolicy); + Objects.requireNonNull(encodeTable, "encodeTable"); this.encodeTable = encodeTable; this.decodeTable = encodeTable == LOWER_CASE_ENCODE_TABLE ? LOWER_CASE_DECODE_TABLE : UPPER_CASE_DECODE_TABLE; }