rust-cssparser icon indicating copy to clipboard operation
rust-cssparser copied to clipboard

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

Open jfkthame opened this issue 1 year ago • 0 comments

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)

jfkthame avatar Jun 05 '24 22:06 jfkthame