diff options
-rw-r--r-- | samsung-ipc/sms.c | 6 |
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; |