aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samsung-ipc/call.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/samsung-ipc/call.c b/samsung-ipc/call.c
index 5173dfc..77c3325 100644
--- a/samsung-ipc/call.c
+++ b/samsung-ipc/call.c
@@ -96,15 +96,16 @@ char* ipc_call_list_response_get_entry_number(struct ipc_message_info *response,
if (num > count)
return NULL;
- for (n = 0; n < num; n++)
+ for (n = 0; n < num + 1; n++)
{
+ if (entry != NULL)
+ pos += entry->number_len;
+
entry = (struct ipc_call_list_entry*) (response->data + pos);
- pos += (unsigned int) (sizeof(struct ipc_call_list_entry) + entry->number_len);
+ pos += (unsigned int) sizeof(struct ipc_call_list_entry);
}
- if (entry == NULL ||
- (unsigned char*) (response->data + pos) == NULL ||
- (unsigned char*) (response->data + pos + entry->number_len) == NULL)
+ if (entry == NULL || (unsigned char*) (response->data + pos) == NULL)
return NULL;
number = (char*) malloc(sizeof(char) * entry->number_len);