-
Notifications
You must be signed in to change notification settings - Fork 91
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
Valid UTF-8 input can cause infinite loop in JONI #17
Comments
In addition, |
@haozhun - can you show some jruby or java code that illustrates the endless loop? |
Java code that illustrate the infinite loop. This can be mitigated by using
Patch: #21 |
Ahh I see, this does not apply to JRuby (checked 1.7.24) because there is a range check. raises |
To avoid endless loop described here: jruby/joni#17 GitOrigin-RevId: 21619a0255e1facf7e1aaa5879ca36956b98e45a
To avoid endless loop described here: jruby/joni#17 (cherry picked from commit 21619a0255e1facf7e1aaa5879ca36956b98e45a) GitOrigin-RevId: 7c698742fa33d97047e98b7bbee9e5307844712b
In #7, @electrum identified a location that can cause inifinite loop in JONI. It is marked as won't fix because input can be sanitized beforehand and JONI assumes that the input is always valid.
When the pattern is
"\uD8000"
, it can be pre-sanitized, as you suggested in #7. What if the pattern is"\\uD800"
? How can the user sanitize it?If JONI is willing to add a check, it would be the same fix for #7, checking whether the return value of
enc.length
is negative inOptExactInfo.concatStr
.The text was updated successfully, but these errors were encountered: