summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-07-21 12:50:04 +0200
committerlaforge <laforge@gnumonks.org>2019-07-21 15:46:57 +0000
commitd0a8b49d51a7f7813d0335e15b21d20bc2c6159f (patch)
treefda0472bb92dd7057f3294c7d0efc3f743bdb618
parentd38ea94fabe2b00653bfa62f8e08772b51a6f474 (diff)
gsm411_sms.c: Handle negative return of gsm340_gen_oa()
Change-Id: I36f56e1fbd72d9b31350dc2f8a53e763f79f4c08 Closes: CID#198533
-rw-r--r--src/host/layer23/src/mobile/gsm411_sms.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/gsm411_sms.c b/src/host/layer23/src/mobile/gsm411_sms.c
index 08df0f28..45decfd9 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -579,6 +579,9 @@ static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms)
sms->address + 1);
else
da_len = gsm340_gen_oa(da, sizeof(da), 0x0, 0x1, sms->address);
+ if (da_len < 0)
+ return da_len;
+
smsp = msgb_put(msg, da_len);
memcpy(smsp, da, da_len);