Fix source index bounds check in sourcemap decoder (#24145)

## Summary

Fix the source index bounds check in `src/sourcemap/Mapping.zig` to
correctly validate indices against the range `[0, sources_count)`.

## Changes

- Changed the bounds check condition from `source_index > sources_count`
to `source_index >= sources_count` on line 452
- This prevents accepting `source_index == sources_count`, which would
be out of bounds when indexing into the sources array

## Test plan

- [x] Built successfully with `bun bd`
- The existing test suite should continue to pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
robobun
2025-10-28 12:32:53 -07:00
committed by GitHub
parent 4f1b90ad1d
commit 98c04e37ec

View File

@@ -455,7 +455,7 @@ pub fn parse(
}
source_index += source_index_delta.value;
if (source_index < 0 or source_index > sources_count) {
if (source_index < 0 or source_index >= sources_count) {
return .{
.fail = .{
.msg = "Invalid source index value",