Change in osmo-bsc[pespin/1-8-0]: bsc_subscr_conn_fsm: fix crash if !conn
Hello osmith, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/c/osmo-bsc/+/26867 to review the following change. Change subject: bsc_subscr_conn_fsm: fix crash if !conn ...................................................................... bsc_subscr_conn_fsm: fix crash if !conn Do not crash in gscon_ensure_mgw_endpoint() if conn is NULL. Related: SYS#5728 Change-Id: Id579243cc9ebbe8f315cd11754166970329dc9cf --- M src/osmo-bsc/bsc_subscr_conn_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/26867/1 diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index c18079f..2140c9b 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -521,6 +521,11 @@ const char *epname; struct mgcp_client *mgcp_client = NULL; + if (!conn) { + LOG_LCHAN(for_lchan, LOGL_ERROR, "no conn!\n"); + return NULL; + } + if (conn->user_plane.mgw_endpoint) return conn->user_plane.mgw_endpoint; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/26867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: pespin/1-8-0 Gerrit-Change-Id: Id579243cc9ebbe8f315cd11754166970329dc9cf Gerrit-Change-Number: 26867 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-MessageType: newchange
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26867 ) Change subject: bsc_subscr_conn_fsm: fix crash if !conn ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/26867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: pespin/1-8-0 Gerrit-Change-Id: Id579243cc9ebbe8f315cd11754166970329dc9cf Gerrit-Change-Number: 26867 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Comment-Date: Tue, 11 Jan 2022 13:05:41 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26867 ) Change subject: bsc_subscr_conn_fsm: fix crash if !conn ...................................................................... bsc_subscr_conn_fsm: fix crash if !conn Do not crash in gscon_ensure_mgw_endpoint() if conn is NULL. Related: SYS#5728 Change-Id: Id579243cc9ebbe8f315cd11754166970329dc9cf --- M src/osmo-bsc/bsc_subscr_conn_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index c18079f..2140c9b 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -521,6 +521,11 @@ const char *epname; struct mgcp_client *mgcp_client = NULL; + if (!conn) { + LOG_LCHAN(for_lchan, LOGL_ERROR, "no conn!\n"); + return NULL; + } + if (conn->user_plane.mgw_endpoint) return conn->user_plane.mgw_endpoint; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/26867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: pespin/1-8-0 Gerrit-Change-Id: Id579243cc9ebbe8f315cd11754166970329dc9cf Gerrit-Change-Number: 26867 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (2)
-
laforge -
pespin