mms: mms wap push length check before pdu processing.

Change-Id: Id5b5572bcd2953e496f03142d13bd2d012225e30
Signed-off-by: Soojung Shin <sj46.shin@samsung.com>
This commit is contained in:
Soojung Shin
2011-03-06 20:43:27 -08:00
committed by Simon Wilson
parent ff5a09904f
commit 7ac1cb787c

View File

@@ -1015,17 +1015,17 @@ public final class BearerData {
boolean decodingtypeUTF8 = Resources.getSystem()
.getBoolean(com.android.internal.R.bool.config_sms_utf8_support);
// 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;
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;
System.arraycopy(userData.payload, 0, payload, 0, copyLen);
userData.payload = payload;
// 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);