mirror of
https://github.com/samba-team/samba.git
synced 2025-02-12 21:58:10 +03:00
r20186: Fix winbind crash bug in WINBIND_GETGROUPS.
response_extra_sent() expects to free a malloced extra_data.data while the add_XX_to_array functions all return talloced memory now. Jeremy, please check. Guenther
This commit is contained in:
parent
fe3ed63d29
commit
9f34c9f369
@ -1217,7 +1217,7 @@ static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid)
|
||||
(struct getgroups_state *)private_data;
|
||||
|
||||
if (success) {
|
||||
if (!add_gid_to_array_unique(NULL, gid,
|
||||
if (!add_gid_to_array_unique(s->state->mem_ctx, gid,
|
||||
&s->token_gids,
|
||||
&s->num_token_gids)) {
|
||||
return;
|
||||
@ -1239,7 +1239,8 @@ static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid)
|
||||
}
|
||||
|
||||
s->state->response.data.num_entries = s->num_token_gids;
|
||||
s->state->response.extra_data.data = s->token_gids;
|
||||
/* s->token_gids are talloced */
|
||||
s->state->response.extra_data.data = smb_xmemdup(s->token_gids, s->num_token_gids * sizeof(gid_t));
|
||||
s->state->response.length += s->num_token_gids * sizeof(gid_t);
|
||||
request_ok(s->state);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user