Files
bun.sh/test/regression
Claude Bot eb65381769 fix: prevent PathBuffer overflow when path length equals MAX_PATH_BYTES
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>
2025-10-19 04:14:42 +00:00
..