Fix #8596: common_getgroups copies too little data
common_getgroups, when called from within the kernel, copies actualCount bytes instead of actualCount * sizeof(gid_t) bytes.
This commit is contained in:
committed by
Rene Gollent
parent
4fd190af6e
commit
021ccbd18f
@@ -191,7 +191,7 @@ common_getgroups(int groupCount, gid_t* groupList, bool kernel)
|
|||||||
|
|
||||||
// copy
|
// copy
|
||||||
if (kernel) {
|
if (kernel) {
|
||||||
memcpy(groupList, groups, actualCount);
|
memcpy(groupList, groups, actualCount * sizeof(gid_t));
|
||||||
} else {
|
} else {
|
||||||
if (!IS_USER_ADDRESS(groupList)
|
if (!IS_USER_ADDRESS(groupList)
|
||||||
|| user_memcpy(groupList, groups,
|
|| user_memcpy(groupList, groups,
|
||||||
|
|||||||
Reference in New Issue
Block a user