aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-07-11 13:19:22 +0600
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-20 03:08:39 +0300
commit97c2065fd4ce90dabbd59150a6c18095d0c63997 (patch)
tree4fc8175e255c4102cae97cceaf46ccc74ef2e5e1
parent3f84c4c1b2a1c1dc615c848ad4cf991460616771 (diff)
lchan_fsm: fix potential NULL-pointer dereference2021q1
Test case TC_lost_sdcch_during_assignment from ttcn3-bsc-test causes osmo-bsc to crash due to for_conn being NULL. Change-Id: I373855b95f8bde0ce8f9c2ae7bf95c9135d33484 Related: SYS#5526, OS#5255
-rw-r--r--src/osmo-bsc/lchan_fsm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 4eb95ff05..ccd885834 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -114,6 +114,18 @@ static void _lchan_on_activation_failure(struct gsm_lchan *lchan, enum lchan_act
case FOR_ASSIGNMENT:
LOG_LCHAN(lchan, LOGL_NOTICE, "Signalling Assignment FSM of error (%s)\n",
lchan->last_error ? : "unknown error");
+ if (!for_conn) {
+ LOG_LCHAN(lchan, LOGL_ERROR,
+ "lchan activation for Assignment failed, but activation request has"
+ " no conn\n");
+ break;
+ }
+ if (!for_conn->assignment.fi) {
+ LOG_LCHAN(lchan, LOGL_ERROR,
+ "lchan activation for Assignment failed, but conn has no ongoing"
+ " assignment procedure\n");
+ break;
+ }
_osmo_fsm_inst_dispatch(for_conn->assignment.fi, ASSIGNMENT_EV_LCHAN_ERROR, lchan,
file, line);
return;