summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2014-01-17 01:57:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-01-17 01:57:52 +0000
commitc4d0696dd37957025bfef2facc4c053847d70be9 (patch)
tree4014bf56f17001a3c6e7d0d08e964b071d0286ec
parent228f4f92e70d9326d473e02bcdcc8faf9e706a4d (diff)
parentef0904106d09a5471f809feec4219dc22fc740fe (diff)
Merge "Make the range checking of BaseInputConnection#setSelection stricter"
-rw-r--r--core/java/android/view/inputmethod/BaseInputConnection.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java
index 5552952049fc..cccfa78544e8 100644
--- a/core/java/android/view/inputmethod/BaseInputConnection.java
+++ b/core/java/android/view/inputmethod/BaseInputConnection.java
@@ -484,10 +484,10 @@ public class BaseInputConnection implements InputConnection {
final Editable content = getEditable();
if (content == null) return false;
int len = content.length();
- if (start > len || end > len) {
+ if (start > len || end > len || start < 0 || end < 0) {
// If the given selection is out of bounds, just ignore it.
// Most likely the text was changed out from under the IME,
- // the the IME is going to have to update all of its state
+ // and the IME is going to have to update all of its state
// anyway.
return true;
}