diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ldap/sdap_async_nested_groups.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_nested_groups.c b/src/providers/ldap/sdap_async_nested_groups.c index e8d5295c..e2071535 100644 --- a/src/providers/ldap/sdap_async_nested_groups.c +++ b/src/providers/ldap/sdap_async_nested_groups.c @@ -2048,6 +2048,18 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) DEBUG(SSSDBG_TRACE_INTERNAL, ("Received %d dereference results, " "about to process them\n", num_entries)); + if (members->num_values < num_entries) { + /* Dereference returned more values than obtained earlier. We need + * to adjust group array size. */ + state->nested_groups = talloc_realloc(state, state->nested_groups, + struct sysdb_attrs *, + num_entries); + if (state->nested_groups == NULL) { + ret = ENOMEM; + goto done; + } + } + for (i = 0; i < num_entries; i++) { ret = sysdb_attrs_get_string(entries[i]->attrs, SYSDB_ORIG_DN, &orig_dn); @@ -2155,6 +2167,15 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) } } + /* adjust size of nested groups array */ + state->nested_groups = talloc_realloc(state, state->nested_groups, + struct sysdb_attrs *, + state->num_groups); + if (state->nested_groups == NULL) { + ret = ENOMEM; + goto done; + } + ret = EOK; done: |