1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

Don't let winbind getgroups crash when we have no gids in the token.

Guenther
(This used to be commit 6a576cfe9b)
This commit is contained in:
Günther Deschner 2008-03-29 00:47:42 +01:00
parent 25da02554b
commit 4ce88f719e

View File

@ -1595,9 +1595,11 @@ static void getgroups_sid2gid_recv(void *private_data, bool success, gid_t gid)
}
s->state->response.data.num_entries = s->num_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);
if (s->num_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);
}