aboutsummaryrefslogtreecommitdiff
path: root/src/mm-generic-gsm.c
diff options
context:
space:
mode:
authorNathan Williams <njw@chromium.org>2011-05-25 17:08:15 -0400
committerDan Williams <dcbw@redhat.com>2011-05-27 10:26:01 -0500
commitb8cb764d080ac385f93cf17b77a0d41861d9670d (patch)
tree9b082fd6f9e03b3003fb66cdd724fff1150fd174 /src/mm-generic-gsm.c
parent6e9b11a047b59e75a478113840e6705724759a30 (diff)
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
Diffstat (limited to 'src/mm-generic-gsm.c')
-rw-r--r--src/mm-generic-gsm.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c
index 0a0a3c11..9cfaddcb 100644
--- a/src/mm-generic-gsm.c
+++ b/src/mm-generic-gsm.c
@@ -3939,7 +3939,7 @@ sms_semi_octets_to_bcd_string (char *dest, const guint8 *octets, int num_octets)
*dest++ = '\0';
}
-/* len is in septets for gsm7 and in digits (semi-octets) for others */
+/* len is in semi-octets */
static char *
sms_decode_address (const guint8 *address, int len)
{
@@ -3952,7 +3952,7 @@ sms_decode_address (const guint8 *address, int len)
if (addrtype == 0xd0) {
guint8 *unpacked;
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,
unpacked_len);
g_free(unpacked);
@@ -4079,14 +4079,6 @@ sms_parse_pdu (const char *hexpdu)
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));
sender_addr = sms_decode_address (&pdu[msg_start_offset + 2],
pdu[msg_start_offset + 1]);