提交 a15a8dc4 编写于 作者: X xuelei

8010814: More buffers are stored or returned without cloning

Reviewed-by: lancea
上级 d9f3c8b4
......@@ -42,7 +42,7 @@ public final class BerDecoder extends Ber {
*/
public BerDecoder(byte buf[], int offset, int bufsize) {
this.buf = buf;
this.buf = buf; // shared buffer, be careful to use this class
this.bufsize = bufsize;
this.origOffset = offset;
......
......@@ -99,7 +99,7 @@ public final class BerEncoder extends Ber {
if (curSeqIndex != 0) {
throw new IllegalStateException("BER encode error: Unbalanced SEQUENCEs.");
}
return buf;
return buf; // shared buffer, be careful to use this method.
}
/**
......
......@@ -134,7 +134,9 @@ final public class StartTlsResponseImpl extends StartTlsResponse {
* @see #negotiate
*/
public void setEnabledCipherSuites(String[] suites) {
this.suites = suites;
// The impl does accept null suites, although the spec requires
// a non-null list.
this.suites = suites == null ? null : suites.clone();
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册