diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-01-13 14:06:44 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-01-13 15:40:08 +0100 |
commit | dd262263954cc01a986ac5232bfd762cd772d6b6 (patch) | |
tree | cd4b9ef390d813c4925175757d5fb3c9fe062be6 | |
parent | 0557ca268d2d8cb5d7af5739b770a5a655e8e1cb (diff) |
call_leg: local_bridge: Avoid null pointer access if CN-side not ready
This happens if for instance an HNBGW drops the RAB-AssignmentRequest
and does nothing with it.
call_leg.c:348:15: runtime error: member access within null pointer of type 'struct rtp_stream'
Related: OS#5401
Change-Id: I67d2d5b2dd3b367c34f929d63c056306ec001431
-rw-r--r-- | src/libmsc/call_leg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libmsc/call_leg.c b/src/libmsc/call_leg.c index 6242a8034..e890f753a 100644 --- a/src/libmsc/call_leg.c +++ b/src/libmsc/call_leg.c @@ -344,6 +344,9 @@ int call_leg_local_bridge(struct call_leg *cl1, uint32_t call_id1, struct gsm_tr } codec = cl1->rtp[RTP_TO_RAN]->codec; + if (!cl1->rtp[RTP_TO_CN] || !cl2->rtp[RTP_TO_CN]) + return -ENOTCONN; + call_leg_ensure_ci(cl1, RTP_TO_CN, call_id1, trans1, &codec, &cl2->rtp[RTP_TO_CN]->local); call_leg_ensure_ci(cl2, RTP_TO_CN, call_id2, trans2, |