summaryrefslogtreecommitdiff
path: root/source3/nsswitch/libwbclient
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/libwbclient')
-rw-r--r--source3/nsswitch/libwbclient/wbc_pwd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/nsswitch/libwbclient/wbc_pwd.c b/source3/nsswitch/libwbclient/wbc_pwd.c
index baee3c3781..d23c378b5f 100644
--- a/source3/nsswitch/libwbclient/wbc_pwd.c
+++ b/source3/nsswitch/libwbclient/wbc_pwd.c
@@ -97,11 +97,13 @@ static struct group *copy_group_entry(struct winbindd_gr *g,
grp->gr_mem[i] = talloc_strdup(grp, mem_p);
BAIL_ON_PTR_ERROR(grp->gr_mem[i], wbc_status);
- *mem_q = ',';
- mem_p++;
- mem_p = mem_q;
+ if (mem_q == NULL) {
+ i += 1;
+ break;
+ }
+ mem_p = mem_q + 1;
}
- grp->gr_mem[g->num_gr_mem] = NULL;
+ grp->gr_mem[i] = NULL;
wbc_status = WBC_ERR_SUCCESS;