mirror of https://github.com/apache/activemq.git
check for null byte passed as parameter
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@629623 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4e3e8c4add
commit
bca91bb068
|
@ -82,14 +82,16 @@ public class TcpBufferedOutputStream extends FilterOutputStream {
|
|||
* @throws IOException
|
||||
*/
|
||||
public void write(byte b[], int off, int len) throws IOException {
|
||||
if ((bufferlen - count) < len) {
|
||||
flush();
|
||||
}
|
||||
if (buffer.length >= len) {
|
||||
System.arraycopy(b, off, buffer, count, len);
|
||||
count += len;
|
||||
} else {
|
||||
out.write(b, off, len);
|
||||
if (b != null) {
|
||||
if ((bufferlen - count) < len) {
|
||||
flush();
|
||||
}
|
||||
if (buffer.length >= len) {
|
||||
System.arraycopy(b, off, buffer, count, len);
|
||||
count += len;
|
||||
} else {
|
||||
out.write(b, off, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue