HDFS-11719. Arrays.fill() wrong index in BlockSender.readChecksum() exception handling. Contributed by Tao Zhang
This commit is contained in:
parent
48319d6eee
commit
6ff509c32a
|
@ -682,9 +682,10 @@ class BlockSender implements java.io.Closeable {
|
||||||
+ " at offset " + offset + " for block " + block, e);
|
+ " at offset " + offset + " for block " + block, e);
|
||||||
ris.closeChecksumStream();
|
ris.closeChecksumStream();
|
||||||
if (corruptChecksumOk) {
|
if (corruptChecksumOk) {
|
||||||
if (checksumOffset < checksumLen) {
|
if (checksumLen > 0) {
|
||||||
// Just fill the array with zeros.
|
// Just fill the array with zeros.
|
||||||
Arrays.fill(buf, checksumOffset, checksumLen, (byte) 0);
|
Arrays.fill(buf, checksumOffset, checksumOffset + checksumLen,
|
||||||
|
(byte) 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue