]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Fix crash in ast_channel_hangupcause_set().
authorRichard Mudgett <rmudgett@digium.com>
Fri, 28 Feb 2014 17:57:45 +0000 (17:57 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 28 Feb 2014 17:57:45 +0000 (17:57 +0000)
* Fix crash in ast_channel_hangupcause_set() because p->owner not checked
before calling.  Regression introduced by the fix for ASTERISK-22621.

(closes issue ASTERISK-23135)
Reported by: OK

(issue ASTERISK-23323)
Reported by: Walter Doekes

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@409156 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 543a3627d5e55fec4003285e07b3309213dab758..02c670628c3c54a47db39fda32125352f1224ac3 100644 (file)
@@ -20949,9 +20949,11 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
                                        /* This 200 OK's SDP is not acceptable, so we need to ack, then hangup */
                                        /* For re-invites, we try to recover */
                                        ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
-                                       p->owner->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
                                        p->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
-                                       sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+                                       if (p->owner) {
+                                               p->owner->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
+                                               sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+                                       }
                                }
                        }
                        ast_rtp_instance_activate(p->rtp);