From 7ac1cb787ca0386e285a8cd10e095b12821aaf7f Mon Sep 17 00:00:00 2001 From: Soojung Shin Date: Sun, 6 Mar 2011 20:43:27 -0800 Subject: mms: mms wap push length check before pdu processing. Change-Id: Id5b5572bcd2953e496f03142d13bd2d012225e30 Signed-off-by: Soojung Shin --- .../internal/telephony/cdma/sms/BearerData.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'telephony/java') 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); -- cgit v1.1