sms: use correct start and length for alphanumeric data
sms_parse_pdu(): Protocol ID doesn't actually affect decoding, so don't fret about its value. ChromeOS: Change-Id: Ia4cb20c415aed1026bb7b8dd4daa8ae53dd749e8
This commit is contained in:

committed by
Dan Williams

parent
6e9b11a047
commit
b8cb764d08
@@ -3939,7 +3939,7 @@ sms_semi_octets_to_bcd_string (char *dest, const guint8 *octets, int num_octets)
|
|||||||
*dest++ = '\0';
|
*dest++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* len is in septets for gsm7 and in digits (semi-octets) for others */
|
/* len is in semi-octets */
|
||||||
static char *
|
static char *
|
||||||
sms_decode_address (const guint8 *address, int len)
|
sms_decode_address (const guint8 *address, int len)
|
||||||
{
|
{
|
||||||
@@ -3952,7 +3952,7 @@ sms_decode_address (const guint8 *address, int len)
|
|||||||
if (addrtype == 0xd0) {
|
if (addrtype == 0xd0) {
|
||||||
guint8 *unpacked;
|
guint8 *unpacked;
|
||||||
guint32 unpacked_len;
|
guint32 unpacked_len;
|
||||||
unpacked = gsm_unpack (address + 1, len, 0, &unpacked_len);
|
unpacked = gsm_unpack (address, (len * 4) / 7, 0, &unpacked_len);
|
||||||
utf8 = (char *)mm_charset_gsm_unpacked_to_utf8 (unpacked,
|
utf8 = (char *)mm_charset_gsm_unpacked_to_utf8 (unpacked,
|
||||||
unpacked_len);
|
unpacked_len);
|
||||||
g_free(unpacked);
|
g_free(unpacked);
|
||||||
@@ -4079,14 +4079,6 @@ sms_parse_pdu (const char *hexpdu)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only handle the basic protocol identifier */
|
|
||||||
if (pdu[tp_pid_offset] != 0) {
|
|
||||||
mm_err ("Unhandled protocol identifier: 0x%02x vs 0x00",
|
|
||||||
pdu[tp_pid_offset]);
|
|
||||||
g_free (pdu);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
smsc_addr = sms_decode_address (&pdu[1], 2 * (pdu[0] - 1));
|
smsc_addr = sms_decode_address (&pdu[1], 2 * (pdu[0] - 1));
|
||||||
sender_addr = sms_decode_address (&pdu[msg_start_offset + 2],
|
sender_addr = sms_decode_address (&pdu[msg_start_offset + 2],
|
||||||
pdu[msg_start_offset + 1]);
|
pdu[msg_start_offset + 1]);
|
||||||
|
Reference in New Issue
Block a user