You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2008/07/06 15:04:06 UTC
svn commit: r674294 -
/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
Author: sebb
Date: Sun Jul 6 06:04:05 2008
New Revision: 674294
URL: http://svn.apache.org/viewvc?rev=674294&view=rev
Log:
Copy input byte array to prevent subsequent external changes
Modified:
commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java?rev=674294&r1=674293&r2=674294&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java Sun Jul 6 06:04:05 2008
@@ -221,7 +221,8 @@
*/
public Base64(int lineLength, byte[] lineSeparator) {
this.lineLength = lineLength;
- this.lineSeparator = lineSeparator;
+ this.lineSeparator = new byte[lineSeparator.length];
+ System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length);
if (lineLength > 0) {
this.encodeSize = 4 + lineSeparator.length;
} else {