aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samsung-ipc/sms.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/samsung-ipc/sms.c b/samsung-ipc/sms.c
index e06890f..f0e2925 100644
--- a/samsung-ipc/sms.c
+++ b/samsung-ipc/sms.c
@@ -109,8 +109,10 @@ void *ipc_sms_save_msg_setup(struct ipc_sms_save_msg_request_header *header,
memcpy(p, &smsc_length, sizeof(smsc_length));
p += sizeof(smsc_length);
- memcpy(p, smsc, smsc_size);
- p += smsc_size;
+ if (smsc != NULL && smsc_size > 0) {
+ memcpy(p, smsc, smsc_size);
+ p += smsc_size;
+ }
memcpy(p, pdu, pdu_size);
p += pdu_size;