Module: kamailio Branch: master Commit: a8cc28b6e0236b21569625baffa865ff4ce0a153 URL: https://github.com/kamailio/kamailio/commit/a8cc28b6e0236b21569625baffa865ff...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2019-11-20T19:31:19+01:00
ims_isc: null terminate dst_uri field
---
Modified: src/modules/ims_isc/isc.c
---
Diff: https://github.com/kamailio/kamailio/commit/a8cc28b6e0236b21569625baffa865ff... Patch: https://github.com/kamailio/kamailio/commit/a8cc28b6e0236b21569625baffa865ff...
---
diff --git a/src/modules/ims_isc/isc.c b/src/modules/ims_isc/isc.c index a095e054e7..a7a142ba94 100644 --- a/src/modules/ims_isc/isc.c +++ b/src/modules/ims_isc/isc.c @@ -66,13 +66,14 @@ int isc_forward(struct sip_msg *msg, isc_match *m, isc_mark *mark, int firstflag /* change destination so it forwards to the app server */ if (msg->dst_uri.s) pkg_free(msg->dst_uri.s); - msg->dst_uri.s = pkg_malloc(m->server_name.len); + msg->dst_uri.s = pkg_malloc(m->server_name.len + 1); if (!msg->dst_uri.s) { LM_ERR("error allocating %d bytes\n", m->server_name.len); return ISC_RETURN_ERROR; } msg->dst_uri.len = m->server_name.len; memcpy(msg->dst_uri.s, m->server_name.s, m->server_name.len); + msg->dst_uri.s[msg->dst_uri.len] = '\0';
/* append branch if last trigger failed */ if (is_route_type(FAILURE_ROUTE) && !firstflag)