aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-05-11 04:04:59 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-05-16 09:03:49 +0000
commite0ef6d1e3258f49a71919198b366ab82d6816e2e (patch)
tree1d7058fce5f6712ce902cdd5d665ae3c1725da9d
parent56e722ff1abc6c4e933ea789d1b5fd1440a91f85 (diff)
libmsc/rtp_stream.c: prevent NULL-pointer dereference
Change-Id: Ie80b9fae490acc9ee8de742e35b6ef59c4388f57 Fixes: CID#198432
-rw-r--r--src/libmsc/rtp_stream.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libmsc/rtp_stream.c b/src/libmsc/rtp_stream.c
index 6163a981f..afe24ad51 100644
--- a/src/libmsc/rtp_stream.c
+++ b/src/libmsc/rtp_stream.c
@@ -141,6 +141,12 @@ static void rtp_stream_fsm_establishing_established(struct osmo_fsm_inst *fi, ui
switch (event) {
case RTP_STREAM_EV_CRCX_OK:
crcx_info = osmo_mgcpc_ep_ci_get_rtp_info(rtps->ci);
+ if (!crcx_info) {
+ LOG_RTPS(rtps, LOGL_ERROR, "osmo_mgcpc_ep_ci_get_rtp_info() has "
+ "failed, ignoring %s\n", osmo_fsm_event_name(fi->fsm, event));
+ return;
+ }
+
osmo_sockaddr_str_from_str(&rtps->local, crcx_info->addr, crcx_info->port);
rtp_stream_update_id(rtps);
osmo_fsm_inst_dispatch(fi->proc.parent, CALL_LEG_EV_RTP_STREAM_ADDR_AVAILABLE, rtps);