summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-06 04:04:08 +0900
committerHarald Welte <laforge@gnumonks.org>2017-11-07 20:55:12 +0000
commit4954fee4c66ec38e7e726ec8a326537ae5ce9405 (patch)
tree81e9aa70718157fc59e7eb219170662a6be450e6
parentdd9909db1d883bd3c1d6bbd2e6ad4ecf35a796c8 (diff)
mncc.c: Ensure proper string buffer NUL termination
Change-Id: I2f58a495f60ed744c1f625dc8df56aa4dc0aa4cb Fixes: Coverity CID#92223
-rw-r--r--src/mncc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mncc.c b/src/mncc.c
index 669a80c..45c062f 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -738,7 +738,7 @@ int mncc_create_remote_leg(struct mncc_connection *conn, struct call *call)
mncc.fields |= MNCC_F_CALLING;
mncc.calling.plan = 1;
mncc.calling.type = 0x0;
- strncpy(mncc.calling.number, call->source, sizeof(mncc.calling.number));
+ osmo_strlcpy(mncc.calling.number, call->source, sizeof(mncc.calling.number));
if (conn->app->use_imsi_as_id) {
snprintf(mncc.imsi, 15, "%s", call->dest);
@@ -746,7 +746,7 @@ int mncc_create_remote_leg(struct mncc_connection *conn, struct call *call)
mncc.fields |= MNCC_F_CALLED;
mncc.called.plan = 1;
mncc.called.type = 0x0;
- strncpy(mncc.called.number, call->dest, sizeof(mncc.called.number));
+ osmo_strlcpy(mncc.called.number, call->dest, sizeof(mncc.called.number));
}
/*