HDFS-14175. EC: Native XOR decoder should reset the output buffer before using it. Contributed by Ayush Saxena.

(cherry picked from commit dacc1a759e)
This commit is contained in:
Surendra Singh Lilhore 2019-01-18 13:55:12 +05:30 committed by Wei-Chiu Chuang
parent 23eed7b201
commit 5436df0c94
1 changed files with 2 additions and 0 deletions

View File

@ -66,6 +66,8 @@ Java_org_apache_hadoop_io_erasurecode_rawcoder_NativeXORRawDecoder_decodeImpl(
numDataUnits + numParityUnits); numDataUnits + numParityUnits);
getOutputs(env, outputs, outputOffsets, xorDecoder->outputs, numParityUnits); getOutputs(env, outputs, outputOffsets, xorDecoder->outputs, numParityUnits);
memset(xorDecoder->outputs[0], 0, chunkSize);
for (i = 0; i < numDataUnits + numParityUnits; i++) { for (i = 0; i < numDataUnits + numParityUnits; i++) {
if (xorDecoder->inputs[i] == NULL) { if (xorDecoder->inputs[i] == NULL) {
continue; continue;