summaryrefslogtreecommitdiffstats
path: root/src/message-waiting.c
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2009-09-10 18:37:40 +0200
committerDenis Kenzior <denkenz@gmail.com>2009-09-10 16:29:55 -0500
commita82c567f0ce35bccf52db24754f46e8d80bac6fe (patch)
tree51d9a4eb45a6a4c76295fe2e531b87e816167b80 /src/message-waiting.c
parentf208e15ea8d2dac372f91c5faf4095c3a8b19d6f (diff)
downloadofono-a82c567f0ce35bccf52db24754f46e8d80bac6fe.tar.bz2
Fix parsing of Enhanced Voicemail notifications.
Diffstat (limited to 'src/message-waiting.c')
-rw-r--r--src/message-waiting.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/message-waiting.c b/src/message-waiting.c
index 36668751..057660ca 100644
--- a/src/message-waiting.c
+++ b/src/message-waiting.c
@@ -554,7 +554,7 @@ static void handle_enhanced_voicemail_iei(struct ofono_message_waiting *mw,
/* 9.2.3.24.13.1 Enhanced Voice Mail Notification */
/* MULTIPLE_SUBSCRIBER_PROFILE */
- profile = (iei[0] >> 2) & 3;
+ profile = ((iei[0] >> 2) & 3) + 1;
/* SM_STORAGE */
if (discard)
@@ -570,14 +570,17 @@ static void handle_enhanced_voicemail_iei(struct ofono_message_waiting *mw,
/* Other parameters currently not supported */
- set = iei[n + 2] > 0 ? TRUE : FALSE;
+ if (length < n + 3)
+ return;
+
+ set = iei[n + 1] > 0 ? TRUE : FALSE;
mw_set_indicator(mw, profile, SMS_MWI_TYPE_VOICE,
- set, iei[n + 2]);
+ set, iei[n + 1]);
} else {
/* 9.2.3.24.13.2 Enhanced Voice Delete Confirmation */
/* MULTIPLE_SUBSCRIBER_PROFILE */
- profile = (iei[0] >> 2) & 3;
+ profile = ((iei[0] >> 2) & 3) + 1;
/* SM_STORAGE */
if (discard)
@@ -591,9 +594,12 @@ static void handle_enhanced_voicemail_iei(struct ofono_message_waiting *mw,
/* Other parameters currently not supported */
- set = iei[n + 2] > 0 ? TRUE : FALSE;
+ if (length < n + 3)
+ return;
+
+ set = iei[n + 1] > 0 ? TRUE : FALSE;
mw_set_indicator(mw, profile, SMS_MWI_TYPE_VOICE,
- set, iei[n + 2]);
+ set, iei[n + 1]);
}
if (mailbox_address.address[0] != '\0')