commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r674294 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
Date Sun, 06 Jul 2008 13:04:06 GMT
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 {



Mime
View raw message