From: Sebastian Harl Date: Mon, 20 Oct 2014 07:42:35 +0000 (+0200) Subject: data: Fixed length of newly allocated array in concat(). X-Git-Tag: sysdb-0.6.0~93 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3d8d3baf2658eec2ccb96fbe666ef7cdfc2a4376;p=sysdb.git data: Fixed length of newly allocated array in concat(). --- 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 */