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 FastRegexMatcher matching multibyte runes with dot matcher . #14059

Conversation

colega
Copy link
Contributor

@colega colega commented May 7, 2024

When zeroOrOneCharacterStringMatcher wach checking the input string, it assumed that if there are more than one bytes, then there are more than one runes, but that's not necessarily true.

When `zeroOrOneCharacterStringMatcher` wach checking the input string,
it assumed that if there are more than one bytes, then there are more
than one runes, but that's not necessarily true.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@jesusvazquez jesusvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM nice catch

@jesusvazquez jesusvazquez merged commit 2524a91 into prometheus:main May 7, 2024
25 checks passed
@colega colega deleted the fix-zero-or-one-character-for-multibyte-runes branch May 7, 2024 14:43
kushalShukla-web pushed a commit to kushalShukla-web/prometheus that referenced this pull request May 13, 2024
When `zeroOrOneCharacterStringMatcher` wach checking the input string,
it assumed that if there are more than one bytes, then there are more
than one runes, but that's not necessarily true.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
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.

None yet

3 participants