Change in osmo-bsc[2021q1]: lchan_fsm: fix potential 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/.

fixeria gerrit-no-reply at lists.osmocom.org
Wed Oct 20 00:08:56 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/25838 )


Change subject: lchan_fsm: fix potential NULL-pointer dereference
......................................................................

lchan_fsm: fix potential NULL-pointer dereference

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
---
M src/osmo-bsc/lchan_fsm.c
1 file changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/38/25838/1

diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 4eb95ff..ccd8858 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -114,6 +114,18 @@
 	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;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25838
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: 2021q1
Gerrit-Change-Id: I373855b95f8bde0ce8f9c2ae7bf95c9135d33484
Gerrit-Change-Number: 25838
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211020/2c7702cc/attachment.htm>


More information about the gerrit-log mailing list