commit 2e9415d8a0645adbfcce6e9dc7f6bbf6be233b6f (tree)
parent 0dbcf97551765d3abbaea5fb0b9e94e5e0be1b14
Author: Andrew Kelley <andrew@ziglang.org>
Date: Fri, 26 Dec 2025 14:11:30 -0800
std.Io.Threaded: fix missing `@memcpy` in realPathPosix for FreeBSD
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig
@@ -4302,6 +4302,7 @@ fn realPathPosix(current_thread: *Thread, fd: posix.fd_t, out_buffer: []u8) File
}
const len = std.mem.findScalar(u8, &k_file.path, 0) orelse k_file.path.len;
if (len == 0) return error.NameTooLong;
+ @memcpy(out_buffer[0..len], k_file.path[0..len]);
return len;
},
else => return error.OperationUnsupported,
diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig
@@ -250,7 +250,7 @@ pub const kinfo_file = extern struct {
/// Reserved for future cap_rights
_cap_spare: u64,
/// Path to file, if any.
- path: [PATH_MAX - 1:0]u8,
+ path: [PATH_MAX]u8,
comptime {
assert(@sizeOf(@This()) == KINFO_FILE_SIZE);