From dacc1a759e3ba3eca000cbacc6145b231253b174 Mon Sep 17 00:00:00 2001 From: Surendra Singh Lilhore Date: Fri, 18 Jan 2019 13:55:12 +0530 Subject: [PATCH] HDFS-14175. EC: Native XOR decoder should reset the output buffer before using it. Contributed by Ayush Saxena. --- .../src/org/apache/hadoop/io/erasurecode/jni_xor_decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/erasurecode/jni_xor_decoder.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/erasurecode/jni_xor_decoder.c index d2de0c67cf..6832aa8253 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/erasurecode/jni_xor_decoder.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/erasurecode/jni_xor_decoder.c @@ -66,6 +66,8 @@ Java_org_apache_hadoop_io_erasurecode_rawcoder_NativeXORRawDecoder_decodeImpl( numDataUnits + numParityUnits); getOutputs(env, outputs, outputOffsets, xorDecoder->outputs, numParityUnits); + memset(xorDecoder->outputs[0], 0, chunkSize); + for (i = 0; i < numDataUnits + numParityUnits; i++) { if (xorDecoder->inputs[i] == NULL) { continue;