summaryrefslogtreecommitdiffstats
path: root/core/java/android/text
diff options
context:
space:
mode:
authorEric Fischer <enf@google.com>2010-02-16 10:37:45 -0800
committerEric Fischer <enf@google.com>2010-02-16 14:34:32 -0800
commita877c034421143932c25daaca5f92a48ef6c3b81 (patch)
treed7f4905471ca60f080ce3677367edf91e040ec2a /core/java/android/text
parent9d4b57545300c6de1722094404ae09bf0f6be937 (diff)
downloadframeworks_base-a877c034421143932c25daaca5f92a48ef6c3b81.zip
frameworks_base-a877c034421143932c25daaca5f92a48ef6c3b81.tar.gz
frameworks_base-a877c034421143932c25daaca5f92a48ef6c3b81.tar.bz2
Keep Rfc822Tokenizer from crashing when the string ends with a backslash.
Bug 2442537
Diffstat (limited to 'core/java/android/text')
-rw-r--r--core/java/android/text/util/Rfc822Tokenizer.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/text/util/Rfc822Tokenizer.java b/core/java/android/text/util/Rfc822Tokenizer.java
index 9d8bfd9..69d745d 100644
--- a/core/java/android/text/util/Rfc822Tokenizer.java
+++ b/core/java/android/text/util/Rfc822Tokenizer.java
@@ -84,7 +84,7 @@ public class Rfc822Tokenizer implements MultiAutoCompleteTextView.Tokenizer {
if (c == '"') {
i++;
break;
- } else if (c == '\\') {
+ } else if (c == '\\' && i + 1 < cursor) {
name.append(text.charAt(i + 1));
i += 2;
} else {
@@ -110,7 +110,7 @@ public class Rfc822Tokenizer implements MultiAutoCompleteTextView.Tokenizer {
comment.append(c);
level++;
i++;
- } else if (c == '\\') {
+ } else if (c == '\\' && i + 1 < cursor) {
comment.append(text.charAt(i + 1));
i += 2;
} else {