diff options
author | Gerald Carter <jerry@samba.org> | 2007-05-21 21:17:21 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2007-05-21 21:17:21 +0000 |
commit | 34059e63c8a644b10cf9a59cca5e67a45053d16e (patch) | |
tree | b0751d47f93023938656df3c6173618dfef4f1e5 /source/nsswitch/winbindd_group.c | |
parent | c3f0e56c057f6be60bd3721485f013ed63defa6a (diff) | |
download | samba-34059e63c8a644b10cf9a59cca5e67a45053d16e.tar.gz samba-34059e63c8a644b10cf9a59cca5e67a45053d16e.tar.xz samba-34059e63c8a644b10cf9a59cca5e67a45053d16e.zip |
r23052: sync with SAMBA_3_0_25 and start updating release notes
Diffstat (limited to 'source/nsswitch/winbindd_group.c')
-rw-r--r-- | source/nsswitch/winbindd_group.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/nsswitch/winbindd_group.c b/source/nsswitch/winbindd_group.c index 1bd00869231..c7baecfbaa6 100644 --- a/source/nsswitch/winbindd_group.c +++ b/source/nsswitch/winbindd_group.c @@ -902,7 +902,7 @@ void winbindd_getgrent(struct winbindd_cli_state *state) { struct getent_state *ent; struct winbindd_gr *group_list = NULL; - int num_groups, group_list_ndx = 0, i, gr_mem_list_len = 0; + int num_groups, group_list_ndx, gr_mem_list_len = 0; char *gr_mem_list = NULL; DEBUG(3, ("[%5lu]: getgrent\n", (unsigned long)state->pid)); @@ -916,6 +916,11 @@ void winbindd_getgrent(struct winbindd_cli_state *state) num_groups = MIN(MAX_GETGRENT_GROUPS, state->request.data.num_entries); + if (num_groups == 0) { + request_error(state); + return; + } + if ((state->response.extra_data.data = SMB_MALLOC_ARRAY(struct winbindd_gr, num_groups)) == NULL) { request_error(state); return; @@ -938,7 +943,7 @@ void winbindd_getgrent(struct winbindd_cli_state *state) /* Start sending back groups */ - for (i = 0; i < num_groups; i++) { + for (group_list_ndx = 0; group_list_ndx < num_groups; ) { struct acct_info *name_list = NULL; fstring domain_group_name; uint32 result; |