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.
This commit is contained in:
Holger Hans Peter Freyther 2016-04-04 20:10:33 +02:00
parent 79538fc220
commit 02b19354e4
1 changed files with 2 additions and 2 deletions

View File

@ -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));
}
/*