summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorSoojung Shin <sj46.shin@samsung.com>2011-03-06 20:43:27 -0800
committerSimon Wilson <simonwilson@google.com>2011-03-07 15:37:01 -0800
commit7ac1cb787ca0386e285a8cd10e095b12821aaf7f (patch)
tree1a53b80e1673dffb7ae0dbcf0d90b57f5d983cb3 /telephony/java
parentff5a09904fb05f2776f1bbf1dd3915f38031190c (diff)
downloadframeworks_base-7ac1cb787ca0386e285a8cd10e095b12821aaf7f.zip
frameworks_base-7ac1cb787ca0386e285a8cd10e095b12821aaf7f.tar.gz
frameworks_base-7ac1cb787ca0386e285a8cd10e095b12821aaf7f.tar.bz2
mms: mms wap push length check before pdu processing.
Change-Id: Id5b5572bcd2953e496f03142d13bd2d012225e30 Signed-off-by: Soojung Shin <sj46.shin@samsung.com>
Diffstat (limited to 'telephony/java')
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/sms/BearerData.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
index e95ec44..7bc48ca 100755
--- a/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
+++ b/telephony/java/com/android/internal/telephony/cdma/sms/BearerData.java
@@ -1015,17 +1015,17 @@ public final class BearerData {
boolean decodingtypeUTF8 = Resources.getSystem()
.getBoolean(com.android.internal.R.bool.config_sms_utf8_support);
- if (!decodingtypeUTF8) {
- // Strip off any padding bytes, meaning any differences between the length of the
- // array and the target length specified by numFields. This is to avoid any
- // confusion by code elsewhere that only considers the payload array length.
- byte[] payload = new byte[userData.numFields];
- int copyLen = userData.numFields < userData.payload.length
- ? userData.numFields : userData.payload.length;
+ // Strip off any padding bytes, meaning any differences between the length of the
+ // array and the target length specified by numFields. This is to avoid any
+ // confusion by code elsewhere that only considers the payload array length.
+ byte[] payload = new byte[userData.numFields];
+ int copyLen = userData.numFields < userData.payload.length
+ ? userData.numFields : userData.payload.length;
- System.arraycopy(userData.payload, 0, payload, 0, copyLen);
- userData.payload = payload;
+ System.arraycopy(userData.payload, 0, payload, 0, copyLen);
+ userData.payload = payload;
+ if (!decodingtypeUTF8) {
// There are many devices in the market that send 8bit text sms (latin encoded) as
// octet encoded.
userData.payloadStr = decodeLatin(userData.payload, offset, userData.numFields);