mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
s3: Use talloc_memdup in copy_unix_token
This commit is contained in:
parent
4586f5176b
commit
77ce431fdb
@ -1493,11 +1493,11 @@ static struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct
|
|||||||
cpy->ngroups = tok->ngroups;
|
cpy->ngroups = tok->ngroups;
|
||||||
if (tok->ngroups) {
|
if (tok->ngroups) {
|
||||||
/* Make this a talloc child of cpy. */
|
/* Make this a talloc child of cpy. */
|
||||||
cpy->groups = TALLOC_ARRAY(cpy, gid_t, tok->ngroups);
|
cpy->groups = (gid_t *)talloc_memdup(
|
||||||
|
cpy, tok->groups, tok->ngroups * sizeof(gid_t));
|
||||||
if (!cpy->groups) {
|
if (!cpy->groups) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memcpy(cpy->groups, tok->groups, tok->ngroups * sizeof(gid_t));
|
|
||||||
}
|
}
|
||||||
return cpy;
|
return cpy;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user