Skip to content

Fix multibyte char after value #15

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

Merged
merged 2 commits into from
May 23, 2025
Merged

Conversation

spyoungtech
Copy link
Owner

@spyoungtech spyoungtech commented May 23, 2025

Issue discovered by fuzz testing. When unexpected input is present after a valid JSON value (in this test case, a hex number) and that character is a multibyte whitespace character, followed by another non-whitespace character, the get_line_col_char routine to generate an error message panics unexpectedly because it is called with a byte offset that lands in the middle of the multibyte whitespace.

For example, before this fix, the input 0xA18[NQSP]{9 panics (where [NQSP] is U+2000).

@spyoungtech spyoungtech merged commit c082d46 into main May 23, 2025
2 checks passed
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.

1 participant