summaryrefslogtreecommitdiff
path: root/src/erasurecode_preprocessing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/erasurecode_preprocessing.c')
-rw-r--r--src/erasurecode_preprocessing.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/erasurecode_preprocessing.c b/src/erasurecode_preprocessing.c
index a9a7b55..d8da1f6 100644
--- a/src/erasurecode_preprocessing.c
+++ b/src/erasurecode_preprocessing.c
@@ -224,6 +224,9 @@ int get_fragment_partition(
*/
for (i = 0; i < num_fragments; i++) {
index = get_fragment_idx(fragments[i]);
+ if (index < 0){
+ return -EBADHEADER;
+ }
if (index < k) {
data[index] = fragments[i];
} else {