diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-09-09 21:07:37 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-09-10 10:32:29 +0200 |
commit | 6a8999bf933f72923a271831d85a01ef88a81f39 (patch) | |
tree | 88716952059d2de92d9524de67be55bc232d2492 /src/db/sysdb_ranges.c | |
parent | f74707245f0517e8d1f2fa7817600ecbc71680c1 (diff) | |
download | sssd2-6a8999bf933f72923a271831d85a01ef88a81f39.tar.gz sssd2-6a8999bf933f72923a271831d85a01ef88a81f39.tar.xz sssd2-6a8999bf933f72923a271831d85a01ef88a81f39.zip |
SYSDB: NULL-terminate the output of sysdb_get_{ranges,subdomains}
Diffstat (limited to 'src/db/sysdb_ranges.c')
-rw-r--r-- | src/db/sysdb_ranges.c | 3 |
1 files changed, 2 insertions, 1 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); |