aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-07-26 18:50:01 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-07-26 18:50:01 +0200
commit873093afb5e94d0e82524e0ad5f8689b2cee18cb (patch)
tree5da857fd3dd618b05cbc994b520d97b4d8055e42
parent379045ee0cc5d136639504cbf9c57de4ee9078d4 (diff)
downloadexternal_libsamsung-ipc-873093afb5e94d0e82524e0ad5f8689b2cee18cb.zip
external_libsamsung-ipc-873093afb5e94d0e82524e0ad5f8689b2cee18cb.tar.gz
external_libsamsung-ipc-873093afb5e94d0e82524e0ad5f8689b2cee18cb.tar.bz2
sms: Only copy when there is actual data
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-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;