Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: panic due incorrect issue's position column resolution in checkCapital #36

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

etilite
Copy link
Contributor

@etilite etilite commented Aug 15, 2024

Bug

The entire text is used to resolve the column for the issue in checkCapital. This leads to incorrect issue's position resolution when the first part of the text consists of 2-byte runes and the line with the issue consists of 1-byte runes.

A panic "slice bounds out of range" occurs if the length of the issue line is less than the resolved column.

The test case demonstrates it.

Fix

Use the current line to resolve the column for the issue in checkCapital.

@tetafro
Copy link
Owner

tetafro commented Sep 7, 2024

Nice! Thanks a lot.

@tetafro tetafro merged commit 348de9f into tetafro:master Sep 7, 2024
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