libmsc/rtp_stream.c: prevent NULL-pointer dereference

Change-Id: Ie80b9fae490acc9ee8de742e35b6ef59c4388f57
Fixes: CID#198432
This commit is contained in:
Vadim Yanitskiy 2019-05-11 04:04:59 +07:00
parent 56e722ff1a
commit e0ef6d1e32
1 changed files with 6 additions and 0 deletions

View File

@ -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);