From 73d7914f1b5c5a94fc646a680c588629adc63197 Mon Sep 17 00:00:00 2001 From: Kevin Greenan Date: Sun, 12 Jul 2015 09:34:17 -0700 Subject: [PATCH] This fixes a bug discovered when passing a new insufficient fragments exception up through Python. The code that preprocesses decoded fragments to see if it can simply concat the data fragments instead of decodeing was not properly deduping fragments, which leads to a failed assertion. This properly dedups fragments in the fragments_to_string function. --- src/erasurecode_preprocessing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/erasurecode_preprocessing.c b/src/erasurecode_preprocessing.c index e23b028..06fd1cc 100644 --- a/src/erasurecode_preprocessing.c +++ b/src/erasurecode_preprocessing.c @@ -323,7 +323,7 @@ int fragments_to_string(int k, int m, continue; } else { /* Make sure we account for duplicates */ - if (NULL != fragments[index]) { + if (NULL == data[index]) { data[index] = fragments[i]; num_data++; }