Skip to content

Commit cad6644

Browse files
committed
Copy input byte array to prevent subsequent external changes
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@674294 13f79535-47bb-0310-9956-ffa450edef68
1 parent df9d1bb commit cad6644

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/java/org/apache/commons/codec/binary/Base64.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ public Base64(int lineLength) {
221221
*/
222222
public Base64(int lineLength, byte[] lineSeparator) {
223223
this.lineLength = lineLength;
224-
this.lineSeparator = lineSeparator;
224+
this.lineSeparator = new byte[lineSeparator.length];
225+
System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length);
225226
if (lineLength > 0) {
226227
this.encodeSize = 4 + lineSeparator.length;
227228
} else {

0 commit comments

Comments
 (0)