aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sec.h2
-rw-r--r--samsung-ipc/sec.c20
2 files changed, 21 insertions, 1 deletions
diff --git a/include/sec.h b/include/sec.h
index 7a1d178..882b586 100644
--- a/include/sec.h
+++ b/include/sec.h
@@ -173,6 +173,8 @@ int ipc_sec_phone_lock_request_set_setup(struct ipc_sec_phone_lock_request_set_d
int ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *data,
unsigned char facility_type, const char *password_old,
const char *password_new);
+size_t ipc_sec_rsim_access_size_setup(struct ipc_sec_rsim_access_request_header *header,
+ const void *sim_io_data, size_t sim_io_size);
void *ipc_sec_rsim_access_setup(struct ipc_sec_rsim_access_request_header *header,
const void *sim_io_data, size_t sim_io_size);
int ipc_sec_lock_infomation_setup(struct ipc_sec_lock_infomation_request_data *data,
diff --git a/samsung-ipc/sec.c b/samsung-ipc/sec.c
index be5dccf..8ec633f 100644
--- a/samsung-ipc/sec.c
+++ b/samsung-ipc/sec.c
@@ -120,6 +120,22 @@ int ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *data,
return 0;
}
+size_t ipc_sec_rsim_access_size_setup(struct ipc_sec_rsim_access_request_header *header,
+ const void *sim_io_data, size_t sim_io_size)
+{
+ size_t size;
+
+ if (header == NULL)
+ return 0;
+
+ if (sim_io_data == NULL)
+ sim_io_size = 0;
+
+ size = sizeof(struct ipc_sec_rsim_access_request_header) + sim_io_size;
+
+ return size;
+}
+
void *ipc_sec_rsim_access_setup(struct ipc_sec_rsim_access_request_header *header,
const void *sim_io_data, size_t sim_io_size)
{
@@ -133,7 +149,9 @@ void *ipc_sec_rsim_access_setup(struct ipc_sec_rsim_access_request_header *heade
if (sim_io_data == NULL)
sim_io_size = 0;
- size = sizeof(struct ipc_sec_rsim_access_request_header) + sim_io_size;
+ size = ipc_sec_rsim_access_size_setup(header, sim_io_data, sim_io_size);
+ if (size == 0)
+ return NULL;
data = calloc(1, size);