-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Milestone
Description
If you create a Matcher from a byte array containing invalid UTF-8, the match() method will spin forever due to invalid characters not being handled by ByteCodeMachine. For example, in the method opAnyCharStar():
while (s < range) {
...
int n = enc.length(bytes, s, end);
if (s + n > range) {opFail(); return;}
...
}
The enc.length() call returns -1 for malformed input, but this value isn't checked for, so the loop never exits. I haven't looked at this deeply enough to know the correct solution, but there are a ton of calls and none of them are checked.
Metadata
Metadata
Assignees
Labels
No labels