mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 19:38:58 +00:00
On Windows, MAX_PATH_BYTES is 98302 (32767 * 3 + 1). When a path string is exactly this length, the code would attempt to: 1. Copy all 98302 bytes to buf[0..98302] 2. Write a null terminator at buf[98302] - which is out of bounds This fix adds a bounds check before the memcpy to ensure we have room for the null terminator. If the path is too long, we panic with a clear error message instead of triggering an out-of-bounds panic. The panic occurred in PathLike.sliceZWithForceCopy at types.zig:601. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>