1
Fork 0

libnss fix: allocate a sufficient array for u32s

we did not multiply by the element size before
main
Motiejus Jakštys 2022-08-09 07:45:09 -07:00
parent 7be5743651
commit b350e8d096
1 changed files with 4 additions and 1 deletions

View File

@ -513,7 +513,10 @@ fn initgroups_dyn(
math.min(@intCast(usize, limit), newsize_want);
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| {
groupsp.* = newgroups.ptr;