Fix segfault
authorMark Spencer <markster@digium.com>
Tue, 9 Nov 2004 02:38:18 +0000 (02:38 +0000)
committerMark Spencer <markster@digium.com>
Tue, 9 Nov 2004 02:38:18 +0000 (02:38 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4190 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index ec20596..a912741 100755 (executable)
@@ -5417,8 +5417,8 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd
                                        strncpy(p->username, peer->username, sizeof(p->username) - 1);
                                        strncpy(p->authname, peer->username, sizeof(p->authname) - 1);
                                }
                                        strncpy(p->username, peer->username, sizeof(p->username) - 1);
                                        strncpy(p->authname, peer->username, sizeof(p->authname) - 1);
                                }
-                               if (!ast_strlen_zero(user->cid_num) && !ast_strlen_zero(p->cid_num))  {
-                                       strncpy(p->cid_num, user->cid_num, sizeof(p->cid_num) - 1);
+                               if (!ast_strlen_zero(peer->cid_num) && !ast_strlen_zero(p->cid_num))  {
+                                       strncpy(p->cid_num, peer->cid_num, sizeof(p->cid_num) - 1);
                                        ast_shrink_phone_number(p->cid_num);
                                }
                                if (!ast_strlen_zero(peer->cid_name) && !ast_strlen_zero(p->cid_name)) 
                                        ast_shrink_phone_number(p->cid_num);
                                }
                                if (!ast_strlen_zero(peer->cid_name) && !ast_strlen_zero(p->cid_name))