aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/call.h2
-rw-r--r--samsung-ipc/call.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/include/call.h b/include/call.h
index e3f2dc7..4f5d152 100644
--- a/include/call.h
+++ b/include/call.h
@@ -148,6 +148,8 @@ unsigned char ipc_call_list_count_extract(const void *data, size_t size);
struct ipc_call_list_entry *ipc_call_list_entry_extract(const void *data,
size_t size, unsigned int index);
char *ipc_call_list_entry_number_extract(const struct ipc_call_list_entry *entry);
+size_t ipc_call_burst_dtmf_size_setup(const struct ipc_call_burst_dtmf_request_entry *entries,
+ unsigned char count);
void *ipc_call_burst_dtmf_setup(const struct ipc_call_burst_dtmf_request_entry *entries,
unsigned char count);
diff --git a/samsung-ipc/call.c b/samsung-ipc/call.c
index 37bdc20..b0720ad 100644
--- a/samsung-ipc/call.c
+++ b/samsung-ipc/call.c
@@ -106,6 +106,19 @@ char *ipc_call_list_entry_number_extract(const struct ipc_call_list_entry *entry
return number;
}
+size_t ipc_call_burst_dtmf_size_setup(const struct ipc_call_burst_dtmf_request_entry *entries,
+ unsigned char count)
+{
+ size_t size;
+
+ if (entries == NULL)
+ return 0;
+
+ size = sizeof(struct ipc_call_burst_dtmf_request_header) + count * sizeof(struct ipc_call_burst_dtmf_request_entry);
+
+ return size;
+}
+
void *ipc_call_burst_dtmf_setup(const struct ipc_call_burst_dtmf_request_entry *entries,
unsigned char count)
{
@@ -116,7 +129,9 @@ void *ipc_call_burst_dtmf_setup(const struct ipc_call_burst_dtmf_request_entry *
if (entries == NULL)
return NULL;
- size = sizeof(struct ipc_call_burst_dtmf_request_header) + count * sizeof(struct ipc_call_burst_dtmf_request_entry);
+ size = ipc_call_burst_dtmf_size_setup(entries, count);
+ if (size == 0)
+ return NULL;
data = calloc(1, size);