diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-02 16:13:43 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-02 16:14:49 +0200 |
commit | fc219be4d46aefe644cc17b6a0976be5c1a732b8 (patch) | |
tree | 9be5b14732f81baaeeb5304afe446aac2d755dc8 | |
parent | c1e70924d8197c51bb8dedb2d232f03dff87aa7b (diff) |
sms-part: properly skip validity field when given in absolute or enhanced format
We don't support absolute or enhanced format for validity, but we still need to
properly skip those fields if given.
According to GSM 03.40, they are both always 7 bytes, not just 1.
-rw-r--r-- | src/mm-sms-part.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mm-sms-part.c b/src/mm-sms-part.c index 846febeb..ffe15a99 100644 --- a/src/mm-sms-part.c +++ b/src/mm-sms-part.c @@ -657,20 +657,24 @@ mm_sms_part_new_from_binary_pdu (guint index, mm_dbg (" validity available, format relative"); mm_sms_part_set_validity (sms_part, relative_to_validity (pdu[offset])); + offset++; break; case 0x08: /* TODO: support enhanced format; GSM 03.40 */ mm_dbg (" validity available, format enhanced (not implemented)"); + /* 7 bytes for enhanced validity */ + offset += 7; break; case 0x18: /* TODO: support absolute format; GSM 03.40 */ mm_dbg (" validity available, format absolute (not implemented)"); + /* 7 bytes for absolute validity */ + offset += 7; break; default: /* Cannot happen as we AND with the 0x18 mask */ g_assert_not_reached(); } - offset++; } tp_user_data_len_offset = offset; |