From: Jeff Peeler Date: Mon, 17 Aug 2009 16:50:45 +0000 (+0000) Subject: Merged revisions 212498 via svnmerge from X-Git-Tag: 11.0.0-beta1~4345 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36b38525a168716efb22a8f1da00d3dec88156d4;p=thirdparty%2Fasterisk.git Merged revisions 212498 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r212498 | jpeeler | 2009-08-17 11:34:56 -0500 (Mon, 17 Aug 2009) | 12 lines Fix segfault when reloading chan_misdn. If more ports were specified than configured in misdn.conf a reload would crash asterisk. The problem was the unconfigured port was using data from the previously configured port. When the data for an unconfigured port was freed a crash would result from the double free. (closes issue #12113) Reported by: agupta Patches: bug12113.patch uploaded by jpeeler (license 325) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212506 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/misdn_config.c b/channels/misdn_config.c index 7318326f6b..7d55a17bb5 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -1035,6 +1035,11 @@ static void _build_port_config (struct ast_variable *v, char *cat) } for (i = 0; i < (max_ports + 1); ++i) { + if (i > 0 && cfg_for_ports[0]) { + /* default category, will populate the port_cfg with additional port + categories in subsequent calls to this function */ + memset(cfg_tmp, 0, sizeof(cfg_tmp)); + } if (cfg_for_ports[i]) { memcpy(port_cfg[i], cfg_tmp, sizeof(cfg_tmp)); }