From c63394201df4e4c1aef4898db6b31d513fa80dd6 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 16 Aug 2006 19:04:10 +0000 Subject: automerge commit git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@40083 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_mgcp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'channels/chan_mgcp.c') diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 8190d9e3a..cb3c3d7ce 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -2478,12 +2478,14 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub if (strncasecmp(v, p->sub->cxident, len) && strncasecmp(v, p->sub->next->cxident, len)) { /* connection id not found. delete it */ - char cxident[80]; - memcpy(cxident, v, len); - cxident[len] = '\0'; + char cxident[80] = ""; + + if (len > (sizeof(cxident) - 1)) + len = sizeof(cxident) - 1; + ast_copy_string(cxident, v, len); if (option_verbose > 2) { ast_verbose(VERBOSE_PREFIX_3 "Non existing connection id %s on %s@%s \n", - cxident, p->name, gw->name); + cxident, p->name, gw->name); } transmit_connection_del_w_params(p, NULL, cxident); } -- cgit v1.2.3