diff options
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb_ranges.c | 3 | ||||
-rw-r--r-- | src/db/sysdb_subdomains.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c index 416bcdd0..f100f5b8 100644 --- a/src/db/sysdb_ranges.c +++ b/src/db/sysdb_ranges.c @@ -78,7 +78,7 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, goto done; } - list = talloc_zero_array(tmp_ctx, struct range_info *, res->count); + list = talloc_zero_array(tmp_ctx, struct range_info *, res->count + 1); if (list == NULL) { ret = ENOMEM; goto done; @@ -142,6 +142,7 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, goto done; } } + list[res->count] = NULL; *range_count = res->count; *range_list = talloc_steal(mem_ctx, list); diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c index 96b8b4b2..b3998a2d 100644 --- a/src/db/sysdb_subdomains.c +++ b/src/db/sysdb_subdomains.c @@ -59,7 +59,7 @@ errno_t sysdb_get_subdomains(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, goto done; } - list = talloc_zero_array(tmp_ctx, struct sysdb_subdom *, res->count); + list = talloc_zero_array(tmp_ctx, struct sysdb_subdom *, res->count + 1); if (list == NULL) { ret = ENOMEM; goto done; @@ -117,6 +117,8 @@ errno_t sysdb_get_subdomains(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, } } + list[res->count] = NULL; + *subdomain_count = res->count; *subdomain_list = talloc_steal(mem_ctx, list); ret = EOK; |