mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
fix integer overflow in IoUring buffer ring size calculation
This commit is contained in:
parent
d4d1efeb3e
commit
6eb17a034a
1 changed files with 1 additions and 1 deletions
|
|
@ -1559,7 +1559,7 @@ pub fn setup_buf_ring(fd: posix.fd_t, entries: u16, group_id: u16) !*align(mem.p
|
|||
if (entries == 0 or entries > 1 << 15) return error.EntriesNotInRange;
|
||||
if (!std.math.isPowerOfTwo(entries)) return error.EntriesNotPowerOfTwo;
|
||||
|
||||
const mmap_size = entries * @sizeOf(linux.io_uring_buf);
|
||||
const mmap_size = @as(usize, entries) * @sizeOf(linux.io_uring_buf);
|
||||
const mmap = try posix.mmap(
|
||||
null,
|
||||
mmap_size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue