diff options
author | Joshua Colp <jcolp@digium.com> | 2006-08-04 18:40:47 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2006-08-04 18:40:47 +0000 |
commit | e306f812df9a7fbc2882df1134ff773d580d33af (patch) | |
tree | 2a0828724610537e61afd8c872e7c89d12a76369 | |
parent | 2410854b3c22fb3b34e267d5b46221c60ffbfa82 (diff) |
Don't assume that a referred by URI will always exist (issue #7641 reported and fixed by AuPix)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 708b1675e..6fcd10d86 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -8306,9 +8306,13 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi *ptr = '\0'; ast_copy_string(referdata->refer_to, refer_to, sizeof(referdata->refer_to)); - if ((ptr = strchr(referred_by_uri, ';'))) /* Remove options */ - *ptr = '\0'; - ast_copy_string(referdata->referred_by, referred_by_uri, sizeof(referdata->referred_by)); + if (referred_by_uri) { + if ((ptr = strchr(referred_by_uri, ';'))) /* Remove options */ + *ptr = '\0'; + ast_copy_string(referdata->referred_by, referred_by_uri, sizeof(referdata->referred_by)); + } else { + referdata->referred_by[0] = '\0'; + } /* Determine transfer context */ if (transferer->owner) /* Mimic behaviour in res_features.c */ |