summaryrefslogtreecommitdiffstats
path: root/tests/CoreTests
diff options
context:
space:
mode:
authorTammo Spalink <tammo@google.com>2009-06-25 16:13:51 +0800
committerTammo Spalink <tammo@google.com>2009-06-29 12:51:22 +0800
commit3a08cec99e104f74f28ba2463f00c8d4e6d1967e (patch)
treea326d7de10c17acce6d1a37f51913de491cff307 /tests/CoreTests
parent9171749700853305f3e6abbcdbd9e02f3a71d459 (diff)
downloadframeworks_base-3a08cec99e104f74f28ba2463f00c8d4e6d1967e.zip
frameworks_base-3a08cec99e104f74f28ba2463f00c8d4e6d1967e.tar.gz
frameworks_base-3a08cec99e104f74f28ba2463f00c8d4e6d1967e.tar.bz2
fix potential string index problems in PhoneNumberUtils.numberToCalledPartyBCDHelper
addresses http://buganizer/issue?id=1489784
Diffstat (limited to 'tests/CoreTests')
-rw-r--r--tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java b/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java
index e8bd239..577d384 100644
--- a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java
@@ -93,6 +93,13 @@ public class PhoneNumberUtilsTest extends TestCase {
assertEquals(b[i], bRet[i]);
}
+ bRet = PhoneNumberUtils.networkPortionToCalledPartyBCDWithLength("+17005550020");
+ assertEquals(8, bRet.length);
+ assertEquals(bRet[0], 7);
+ for (int i = 1; i < 8; i++) {
+ assertEquals(b[i - 1], bRet[i]);
+ }
+
bRet = PhoneNumberUtils.networkPortionToCalledPartyBCD("7005550020");
assertEquals("7005550020",
PhoneNumberUtils.calledPartyBCDToString(bRet, 0, bRet.length));