From 54bb82e94c17f3c6a3a7e17b56f50f2a8c755e2e Mon Sep 17 00:00:00 2001
From: Pawel Dziepak <pdziepak@quarnos.org>
Date: Tue, 22 May 2012 21:32:36 +0200
Subject: [PATCH] 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.
---
src/system/kernel/usergroup.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/system/kernel/usergroup.cpp b/src/system/kernel/usergroup.cpp
index 33eabac..5a54ea0 100644
a
|
b
|
common_getgroups(int groupCount, gid_t* groupList, bool kernel)
|
191 | 191 | |
192 | 192 | // copy |
193 | 193 | if (kernel) { |
194 | | memcpy(groupList, groups, actualCount); |
| 194 | memcpy(groupList, groups, actualCount * sizeof(gid_t)); |
195 | 195 | } else { |
196 | 196 | if (!IS_USER_ADDRESS(groupList) |
197 | 197 | || user_memcpy(groupList, groups, |