diff options
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/ldap/sdap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index aa6b0e921..b303547a4 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -36,7 +36,7 @@ int sdap_copy_map(TALLOC_CTX *memctx, struct sdap_attr_map *map; int i; - map = talloc_array(memctx, struct sdap_attr_map, num_entries); + map = talloc_array(memctx, struct sdap_attr_map, num_entries + 1); if (!map) { return ENOMEM; } @@ -64,6 +64,9 @@ int sdap_copy_map(TALLOC_CTX *memctx, map[i].name ? map[i].name : ""); } + /* Include the sentinel */ + memset(&map[num_entries], 0, sizeof(struct sdap_attr_map)); + *_map = map; return EOK; } |