--- /Base64.java	2023-07-05 03:12:37.206026759 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/binary/Base64.java	2023-07-05 03:12:37.210026759 +0200
@@ -374,7 +374,7 @@
         if (isChunked) {
             // we also add a separator to the end of the final chunk.
             if (chunksSoFar < chunckCount) {
-                System.arraycopy(CHUNK_SEPARATOR, 0, encodedData, encodedDataLength - CHUNK_SEPARATOR.length,
+if  ( chunksSoFar < chunckCount )  {     arraycopy ( CHUNK_SEPARATOR, 0, encodedData,  ( encodedDataLength -  ( length )  ) , length ) ; }
                         CHUNK_SEPARATOR.length);
             }
         }
