Skip to content
Snippets Groups Projects
Commit 283d2df6 authored by George Joseph's avatar George Joseph
Browse files

res_pjsip_sdp_rtp: Add NULL check in add_crypto_to_stream

add_crypto_to_stream wasn't checking for a NULL
session->inv_session->neg before calling pjmedia_sdp_neg_get_state.
This was causing a crash if the negotiation hadn't already been
completed and asterisk was compiled with --enable-dev-mode.

Change-Id: I57c6229954a38145da9810fc18657bfcc4d9d0c9
parent ec984870
No related branches found
No related tags found
No related merge requests found
......@@ -1253,7 +1253,8 @@ static int add_crypto_to_stream(struct ast_sip_session *session,
/* If this is an answer we need to use our current state, if it's an offer we need to use
* the configured value.
*/
if (pjmedia_sdp_neg_get_state(session->inv_session->neg) != PJMEDIA_SDP_NEG_STATE_DONE) {
if (session->inv_session->neg
&& pjmedia_sdp_neg_get_state(session->inv_session->neg) != PJMEDIA_SDP_NEG_STATE_DONE) {
setup = dtls->get_setup(session_media->rtp);
} else {
setup = session->endpoint->media.rtp.dtls_cfg.default_setup;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment