Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tree-sitter-ci-bot[bot]
Copy link

Description

Backport of #4632 to release-0.25.

**Problem:** When encountering an invalid symbol at the beginning of the
file, the rust bindings attempt to index the character at position -1 of
the query source, which leads to an overflow and thus invalid character
index which causes a panic.

**Solution:** Bounds check the offset before performing the subtraction.

(cherry picked from commit dff828c)
@clason clason force-pushed the backport-4632-to-release-0.25 branch from 533b467 to d1ac09a Compare July 22, 2025 15:51
@clason
Copy link
Contributor

clason commented Jul 25, 2025

7th time's the charm.

@clason clason merged commit 81e7410 into release-0.25 Jul 25, 2025
39 of 54 checks passed
@clason clason deleted the backport-4632-to-release-0.25 branch July 25, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants