mncc: Only copy 15 chars to leave the last one as NULL

Right now we are lucky the next byte after imsi is already set
to NUL here but we should not rely on that.
This commit is contained in:
Holger Hans Peter Freyther 2016-04-01 15:42:41 +02:00
parent 3d2787646b
commit c313ab0f6b
1 changed files with 1 additions and 1 deletions

View File

@ -656,7 +656,7 @@ int mncc_create_remote_leg(struct mncc_connection *conn, struct call *call,
memcpy(&mncc.calling.number, calling, sizeof(mncc.calling.number)); memcpy(&mncc.calling.number, calling, sizeof(mncc.calling.number));
if (conn->app->use_imsi_as_id) { if (conn->app->use_imsi_as_id) {
snprintf(mncc.imsi, 16, called); snprintf(mncc.imsi, 15, called);
} else { } else {
mncc.fields |= MNCC_F_CALLED; mncc.fields |= MNCC_F_CALLED;
mncc.called.plan = 1; mncc.called.plan = 1;