]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fixes crash with notifycid
authorDavid Vossel <dvossel@digium.com>
Wed, 18 Aug 2010 14:28:52 +0000 (14:28 +0000)
committerDavid Vossel <dvossel@digium.com>
Wed, 18 Aug 2010 14:28:52 +0000 (14:28 +0000)
(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

channels/chan_sip.c

index 628ebe151dee2b2d24f3eefc030180479832f767..9c4bf92b8b7c8a93f0bb5fe2c63f3d5962148e54 100644 (file)
@@ -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;
                                }