authorgravatar for karl.bohlmark@gmail.comKarl Bohlmark <karl.bohlmark@gmail.com> 2024-05-07 07:08:31+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-09 16:00:01-07:00
log6eb17a034a84c397454b9a59054045a2da1d0790
treed92f13f47011a217345368d5803ad5920af83652
parentd4d1efeb3ecd038fbbb569781713d51a1a7d37ed

fix integer overflow in IoUring buffer ring size calculation


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/os/linux/IoUring.zig+1-1
......@@ -1559,7 +1559,7 @@ pub fn setup_buf_ring(fd: posix.fd_t, entries: u16, group_id: u16) !*align(mem.p
15591559 if (entries == 0 or entries > 1 << 15) return error.EntriesNotInRange;
15601560 if (!std.math.isPowerOfTwo(entries)) return error.EntriesNotPowerOfTwo;
15611561
1562 const mmap_size = entries * @sizeOf(linux.io_uring_buf);
1562 const mmap_size = @as(usize, entries) * @sizeOf(linux.io_uring_buf);
15631563 const mmap = try posix.mmap(
15641564 null,
15651565 mmap_size,