diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-04 18:40:47 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-04 18:40:47 +0000 |
commit | 84c1e0fb2f2401982032dd8145e0ba1a1064e4cb (patch) | |
tree | 2a0828724610537e61afd8c872e7c89d12a76369 | |
parent | c330d95877552c173e3659d0ae39f2ab04b69bdc (diff) |
Don't assume that a referred by URI will always exist (issue #7641 reported and fixed by AuPix)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38853 f38db490-d61c-443f-a65b-d21fe96a405b
-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 */ |