libnss fix: allocate a sufficient array for u32s
we did not multiply by the element size before
This commit is contained in:
parent
7be5743651
commit
b350e8d096
@ -513,7 +513,10 @@ fn initgroups_dyn(
|
|||||||
math.min(@intCast(usize, limit), newsize_want);
|
math.min(@intCast(usize, limit), newsize_want);
|
||||||
|
|
||||||
var buf = groupsp.*[0..oldsize];
|
var buf = groupsp.*[0..oldsize];
|
||||||
const new_groups = state.initgroups_dyn_allocator.realloc(buf, newsize);
|
const new_groups = state.initgroups_dyn_allocator.realloc(
|
||||||
|
buf,
|
||||||
|
newsize * @sizeOf(u32),
|
||||||
|
);
|
||||||
|
|
||||||
if (new_groups) |newgroups| {
|
if (new_groups) |newgroups| {
|
||||||
groupsp.* = newgroups.ptr;
|
groupsp.* = newgroups.ptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user