From 6a8999bf933f72923a271831d85a01ef88a81f39 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Sun, 9 Sep 2012 21:07:37 +0200 Subject: SYSDB: NULL-terminate the output of sysdb_get_{ranges,subdomains} --- src/db/sysdb_subdomains.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/db/sysdb_subdomains.c') 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; -- cgit