am 10993b2d: am 6b6869d5: Merge "mms: mms wap push length check before pdu processing." into gingerbread

* commit '10993b2d1e3614073970aad119ffb2cc9bc8f73f':
  mms: mms wap push length check before pdu processing.
This commit is contained in:
Simon Wilson
2011-03-08 07:58:20 -08:00
committed by Android Git Automerger

View File

@@ -1013,17 +1013,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);