Skip to content

Commit b10d396

Browse files
Gilles DebunneAndroid (Google) Code Review
authored andcommitted
Merge "Bug 5385279: IOOB in createMisspelledSuggestionSpan"
2 parents ba25c01 + c08ec61 commit b10d396

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/java/android/widget/SpellChecker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ private void createMisspelledSuggestionSpan(Editable editable,
239239
SuggestionsInfo suggestionsInfo, SpellCheckSpan spellCheckSpan) {
240240
final int start = editable.getSpanStart(spellCheckSpan);
241241
final int end = editable.getSpanEnd(spellCheckSpan);
242+
if (start < 0 || end < 0) return; // span was removed in the meantime
242243

243244
// Other suggestion spans may exist on that region, with identical suggestions, filter
244245
// them out to avoid duplicates. First, filter suggestion spans on that exact region.

0 commit comments

Comments
 (0)