summaryrefslogtreecommitdiffstats
path: root/telephony/java/com
diff options
context:
space:
mode:
authorAmit Mahajan <amitmahajan@google.com>2014-09-05 19:31:58 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-05 19:31:58 +0000
commit5e615d8e6b139929fd3ec81797a1b4085368aedd (patch)
treeee3ba42f508eb97030a2c4397f3bc29e6f711049 /telephony/java/com
parent74155c2ea81d1eff005cbedee3b6f1578ea5ac0d (diff)
parentf11b43d8bf80c68fc24626ea6417032ae250c556 (diff)
downloadframeworks_base-5e615d8e6b139929fd3ec81797a1b4085368aedd.zip
frameworks_base-5e615d8e6b139929fd3ec81797a1b4085368aedd.tar.gz
frameworks_base-5e615d8e6b139929fd3ec81797a1b4085368aedd.tar.bz2
am d494e6cb: Merge "Fix the IndexOutOfBoundsException when unpacking GSM 8-bit pdu" into lmp-dev
* commit 'd494e6cb1e61da0250261b7cdb76dd791c0c9571': Fix the IndexOutOfBoundsException when unpacking GSM 8-bit pdu
Diffstat (limited to 'telephony/java/com')
-rw-r--r--telephony/java/com/android/internal/telephony/GsmAlphabet.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
index 4cba70d..d1c8ef0 100644
--- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java
+++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java
@@ -609,16 +609,25 @@ public class GsmAlphabet {
}
} else {
if (prevWasEscape) {
- char shiftChar = shiftTableToChar.charAt(c);
+ char shiftChar =
+ c < shiftTableToChar.length() ? shiftTableToChar.charAt(c) : ' ';
if (shiftChar == ' ') {
// display character from main table if not present in shift table
- ret.append(languageTableToChar.charAt(c));
+ if (c < languageTableToChar.length()) {
+ ret.append(languageTableToChar.charAt(c));
+ } else {
+ ret.append(' ');
+ }
} else {
ret.append(shiftChar);
}
} else {
if (!isMbcs || c < 0x80 || i + 1 >= offset + length) {
- ret.append(languageTableToChar.charAt(c));
+ if (c < languageTableToChar.length()) {
+ ret.append(languageTableToChar.charAt(c));
+ } else {
+ ret.append(' ');
+ }
} else {
// isMbcs must be true. So both mbcsBuffer and charset are initialized.
mbcsBuffer.clear();