From 3d8d3baf2658eec2ccb96fbe666ef7cdfc2a4376 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 20 Oct 2014 09:42:35 +0200 Subject: [PATCH] data: Fixed length of newly allocated array in concat(). --- src/core/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/data.c b/src/core/data.c index 0e40474..1baeada 100644 --- a/src/core/data.c +++ b/src/core/data.c @@ -279,7 +279,7 @@ data_concat(const sdb_data_t *d1, const sdb_data_t *d2, sdb_data_t *res) } else if (d1->type & SDB_TYPE_ARRAY) { res->data.array.values = new; - res->data.array.length = len1 + len2; + res->data.array.length = d1->data.array.length + d2->data.array.length; if (copy_array_values(res, res, sdb_data_sizeof(res->type & 0xff))) { /* this leaks already copied values but there's not much we can * do and this should only happen if we're in trouble anyway */ -- 2.30.2