From: David Vossel Date: Wed, 18 Aug 2010 14:28:52 +0000 (+0000) Subject: fixes crash with notifycid X-Git-Tag: 1.6.2.12-rc1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5338d346b0e344a4bac31db7ebafaf74270fb9e5;p=thirdparty%2Fasterisk.git fixes crash with notifycid (closes issue #17868) Reported by: francesco_r Patches: issue_17868.diff uploaded by dvossel (license 671) Tested by: francesco_r git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@282668 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 628ebe151d..9c4bf92b8b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11315,7 +11315,9 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int tim int need = strlen(caller->cid.cid_num) + strlen(p->fromdomain) + sizeof("sip:@"); local_target = alloca(need); snprintf(local_target, need, "sip:%s@%s", caller->cid.cid_num, p->fromdomain); - local_display = ast_strdupa(caller->cid.cid_name); + if (!(ast_strlen_zero(caller->cid.cid_name))) { + local_display = ast_strdupa(caller->cid.cid_name); + } ast_channel_unlock(caller); caller = NULL; }