Skip to content

Commit f49428a

Browse files
committed
The method
org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder.setLineSeparator(byte...) now makes a defensive copy
1 parent 20df4c9 commit f49428a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The <action> type attribute can be add,update,fix,remove.
6464
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in org.apache.commons.codec.digest.Md5Crypt.</action>
6565
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix PMD EmptyControlStatement in org.apache.commons.codec.language.Metaphone.</action>
6666
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs [ERROR] Medium: org.apache.commons.codec.binary.BaseNCodec$AbstractBuilder.setEncodeTable(byte[]) may expose internal representation by storing an externally mutable object into BaseNCodec$AbstractBuilder.encodeTable [org.apache.commons.codec.binary.BaseNCodec$AbstractBuilder] At BaseNCodec.java:[line 131] EI_EXPOSE_REP2.</action>
67+
<action type="fix" dev="ggregory" due-to="Gary Gregory">The method org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder.setLineSeparator(byte...) now makes a defensive copy.</action>
6768
<!-- ADD -->
6869
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmac(Path).</action>
6970
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmacHex(Path).</action>

src/main/java/org/apache/commons/codec/binary/BaseNCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public B setLineLength(final int lineLength) {
150150
* @return {@code this} instance.
151151
*/
152152
public B setLineSeparator(final byte... lineSeparator) {
153-
this.lineSeparator = lineSeparator != null ? lineSeparator : CHUNK_SEPARATOR;
153+
this.lineSeparator = lineSeparator != null ? lineSeparator.clone() : CHUNK_SEPARATOR;
154154
return asThis();
155155
}
156156

0 commit comments

Comments
 (0)