From 11b707616800e08891f6b610be90033acda8ffd0 Mon Sep 17 00:00:00 2001 From: Xiaojun Bi Date: Fri, 18 Apr 2014 10:52:15 -0700 Subject: Fix a bug for counting code points in WordComposer.java This bug threw an ArrayIndexOutOfBoundsException when the word length is 49 (maxSize + 1) when calling StringUtils.copyCodePointsAndReturnCodePointCount(...) in the same function. This bug is discovered by running SKETCH. The intent is to count the code points from index 0 to index i (included). The original code only counted the code points from index 0 to index (i-1). Bug: 13969542 Change-Id: Idbf596aba2379ba552dbe580c83c42044d505aaf --- java/src/com/android/inputmethod/latin/BinaryDictionary.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionary.java') diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 5e36d9703..88174ba83 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -260,7 +260,7 @@ public final class BinaryDictionary extends Dictionary { final int inputSize; if (!isGesture) { inputSize = composer.copyCodePointsExceptTrailingSingleQuotesAndReturnCodePointCount( - mInputCodePoints, MAX_WORD_LENGTH); + mInputCodePoints); if (inputSize < 0) { return null; } -- cgit v1.2.3-83-g751a