summaryrefslogtreecommitdiff
path: root/channels/chan_pjsip.c
diff options
context:
space:
mode:
authorScott Griepentrog <scott@griepentrog.com>2015-09-17 13:09:56 -0500
committerScott Griepentrog <scott@griepentrog.com>2015-09-17 13:14:11 -0500
commit87f04d5acfd6ba3ce581eb41a44d2eb0d65680ff (patch)
treeb3898c8b6f935e92713ac762502db35856007b17 /channels/chan_pjsip.c
parente47396721f9c73b16ac7c7632dcd530f4e5b06c7 (diff)
PJSIP: avoid crash when getting rtp peer
Although unlikely, if the tech private is returned as a NULL, chan_pjsip_get_rtp_peer() would crash. ASTERISK-25323 Change-Id: Ie231369bfa7da926fb2b9fdaac228261a3152e6a
Diffstat (limited to 'channels/chan_pjsip.c')
-rw-r--r--channels/chan_pjsip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 9603f0514..153b2a33b 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -160,10 +160,10 @@ static struct ast_sip_session_supplement chan_pjsip_ack_supplement = {
static enum ast_rtp_glue_result chan_pjsip_get_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
- struct chan_pjsip_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt;
struct ast_sip_endpoint *endpoint;
- if (!pvt || !channel->session || !pvt->media[SIP_MEDIA_AUDIO]->rtp) {
+ if (!channel || !channel->session || !(pvt = channel->pvt) || !pvt->media[SIP_MEDIA_AUDIO]->rtp) {
return AST_RTP_GLUE_RESULT_FORBID;
}