fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42599?usp=email )
Change subject: handover_fsm: send_handover_performed(): check lchan != NULL ......................................................................
handover_fsm: send_handover_performed(): check lchan != NULL
The target lchan is expected to be valid on HO_RESULT_OK, but it's still safer to check it against NULL before dereferencing.
Change-Id: Iee734c98dc79681808e7d75360c208a941cc6821 Related: 107391d8c ("handover_fsm: fix send_handover_performed() using wrong lchan") --- M src/osmo-bsc/handover_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified jolly: Looks good to me, but someone else must approve
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index cddb138..2017637 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -905,6 +905,11 @@ struct gsm0808_speech_codec sc; int rc;
+ if (lchan == NULL) { + LOG_HO(conn, LOGL_ERROR, "Target lchan is NULL, can't send HANDOVER PERFORMED!\n"); + return; + } + /* Cause 3.2.2.5 */ ho_perf_params.cause = GSM0808_CAUSE_HANDOVER_SUCCESSFUL;