Change in osmo-msc[master]: libmsc/rtp_stream.c: prevent NULL-pointer dereference

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu May 16 09:03:50 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/13980 )

Change subject: libmsc/rtp_stream.c: prevent NULL-pointer dereference
......................................................................

libmsc/rtp_stream.c: prevent NULL-pointer dereference

Change-Id: Ie80b9fae490acc9ee8de742e35b6ef59c4388f57
Fixes: CID#198432
---
M src/libmsc/rtp_stream.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/rtp_stream.c b/src/libmsc/rtp_stream.c
index 6163a98..afe24ad 100644
--- a/src/libmsc/rtp_stream.c
+++ b/src/libmsc/rtp_stream.c
@@ -141,6 +141,12 @@
 	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);

-- 
To view, visit https://gerrit.osmocom.org/13980
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie80b9fae490acc9ee8de742e35b6ef59c4388f57
Gerrit-Change-Number: 13980
Gerrit-PatchSet: 6
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190516/9a3503c3/attachment.htm>


More information about the gerrit-log mailing list