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: invalid unicode input results in endless loop #17 #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sebthom
Copy link
Contributor

@sebthom sebthom commented Jan 10, 2025

This is based on #21 It only adds the minimum modifications required to make the newly added test case succeed.

@headius
Copy link
Member

headius commented Jan 15, 2025

@lopex Perhaps this is another case where the macros should be used to check result?

@headius headius modified the milestones: 2.2.2, 2.2.3, 2.2.4 Jan 15, 2025
@headius headius modified the milestones: 2.2.4, 2.2.5 Mar 3, 2025
@headius
Copy link
Member

headius commented Mar 3, 2025

We're still unsure about this issue. It is reproducible with the example from #17 but we're unsure if this is the best fix. It's not possible to reproduce in Ruby because the bad UTF-8 gets rejected before it ever gets into a regex. If we could reproduce with Onigmo, we could file the issue with them (or with ruby-core) to see how they would fix it.

@headius
Copy link
Member

headius commented Mar 3, 2025

I experimented with checking for return value of codeToMbc less than zero and that did not fix the issue (still hangs in a loop). Interestingly, the fix in this PR solves the hanging loop, but fails a few other tests locally (unsure if this is related to recent changes or something I did).

@headius headius removed this from the 2.2.5 milestone Mar 7, 2025
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