mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
Kernel: Use copy_n_from_user in sys$setgroups to check for overflow
This commit is contained in:
parent
4743afeaf4
commit
d934e77522
1 changed files with 1 additions and 1 deletions
|
@ -150,7 +150,7 @@ int Process::sys$setgroups(ssize_t count, Userspace<const gid_t*> user_gids)
|
||||||
|
|
||||||
Vector<gid_t> gids;
|
Vector<gid_t> gids;
|
||||||
gids.resize(count);
|
gids.resize(count);
|
||||||
if (!copy_from_user(gids.data(), user_gids.unsafe_userspace_ptr(), sizeof(gid_t) * count))
|
if (!copy_n_from_user(gids.data(), user_gids, count))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
HashTable<gid_t> unique_extra_gids;
|
HashTable<gid_t> unique_extra_gids;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue