aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-08-04 14:17:57 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-08-04 14:18:06 +0200
commit688d331defc205502cf8d672d09a5a81cf226750 (patch)
treef52f6817de24ddeb64130926bc7011f9e38364a8
parentd0de45e9191fd8c9a99487f5123844b86f07d5de (diff)
downloadexternal_libsamsung-ipc-688d331defc205502cf8d672d09a5a81cf226750.zip
external_libsamsung-ipc-688d331defc205502cf8d672d09a5a81cf226750.tar.gz
external_libsamsung-ipc-688d331defc205502cf8d672d09a5a81cf226750.tar.bz2
sms: Arguments check
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--samsung-ipc/sms.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/samsung-ipc/sms.c b/samsung-ipc/sms.c
index 0e0c807..a93c5d9 100644
--- a/samsung-ipc/sms.c
+++ b/samsung-ipc/sms.c
@@ -180,6 +180,9 @@ size_t ipc_sms_svc_center_addr_smsc_size_extract(const void *data, size_t size)
{
struct ipc_sms_svc_center_addr_header *header;
+ if (data == NULL || size < sizeof(struct ipc_sms_svc_center_addr_header))
+ return 0;
+
header = (struct ipc_sms_svc_center_addr_header *) data;
if (header->length == 0 || header->length > size - sizeof(struct ipc_sms_svc_center_addr_header))
return 0;
@@ -192,6 +195,9 @@ void *ipc_sms_svc_center_addr_smsc_extract(const void *data, size_t size)
struct ipc_sms_svc_center_addr_header *header;
void *smsc;
+ if (data == NULL || size < sizeof(struct ipc_sms_svc_center_addr_header))
+ return NULL;
+
header = (struct ipc_sms_svc_center_addr_header *) data;
if (header->length == 0 || header->length > size - sizeof(struct ipc_sms_svc_center_addr_header))
return NULL;