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

[unicode-range] Avoid integer overflow (panic in debug builds) #391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jfkthame
Copy link

@jfkthame jfkthame commented Jun 5, 2024

If a long string of hex digits are passed to unicode-range, the code tries to parse them into a number before checking whether there are more than the 6 digits allowed by the syntax, and this may lead to integer overflow.

To avoid this, check the number of digits and error out earlier if there are too many to possibly be valid.

(See https://bugzilla.mozilla.org/show_bug.cgi?id=1900403)

If a long string of hex digits are passed to unicode-range, the code tries to
parse them into a number before checking whether there are more than the 6 digits
allowed by the syntax, and this may lead to integer overflow.

To avoid this, check the number of digits and error out earlier if there are
too many to possibly be valid.

(See https://bugzilla.mozilla.org/show_bug.cgi?id=1900403)
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