]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't assume that a referred by URI will always exist (issue #7641 reported and fixed...
authorJoshua Colp <jcolp@digium.com>
Fri, 4 Aug 2006 18:40:47 +0000 (18:40 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 4 Aug 2006 18:40:47 +0000 (18:40 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38853 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 708b1675efa6b033d607946bafb917a0b5c318d8..6fcd10d86b777b4111a66dc86c1fcd134287002d 100644 (file)
@@ -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 */