mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-12646 Handling out-of-bounds confusable entries in icu4j; see r39360 for icu4c.
X-SVN-Rev: 39363
This commit is contained in:
parent
a1b7d39c3b
commit
cd47bd50e6
1 changed files with 6 additions and 0 deletions
|
@ -962,6 +962,12 @@ public class SpoofChecker {
|
|||
SPUString targetMapping = fTable.get(keyChar);
|
||||
assert targetMapping != null;
|
||||
|
||||
// Throw a sane exception if trying to consume a long string. Otherwise,
|
||||
// codePointAndLengthToKey will throw an assertion error.
|
||||
if (targetMapping.fStr.length() > 256) {
|
||||
throw new IllegalArgumentException("Confusable prototypes cannot be longer than 256 entries.");
|
||||
}
|
||||
|
||||
int key = ConfusableDataUtils.codePointAndLengthToKey(keyChar, targetMapping.fStr.length());
|
||||
int value = targetMapping.fCharOrStrTableIndex;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue