summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-04 20:10:33 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-04 20:16:27 +0200
commit02b19354e4b3f577d65019065002b53262b4518b (patch)
tree64709e996ba0f660fae74e19875983386d7a405d /src
parent79538fc2203ea72dab9167f5c7faa8ef0678c474 (diff)
mncc: Use strcpy for these routines and not memcpy
We need to stop on the first occurence of a \0 in the address provided by SIP. Do not copy the full amount of bytes.
Diffstat (limited to 'src')
-rw-r--r--src/mncc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mncc.c b/src/mncc.c
index a1926e4..b13c5df 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -670,7 +670,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;
- memcpy(&mncc.calling.number, call->source, sizeof(mncc.calling.number));
+ strncpy(mncc.calling.number, call->source, sizeof(mncc.calling.number));
if (conn->app->use_imsi_as_id) {
snprintf(mncc.imsi, 15, "%s", call->dest);
@@ -678,7 +678,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;
- memcpy(&mncc.called.number, call->dest, sizeof(mncc.called.number));
+ strncpy(mncc.called.number, call->dest, sizeof(mncc.called.number));
}
/*