Change in osmo-bsc[master]: VTY: fix NULL-pointer dereference in lchan_act_single()

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
Fri Jun 4 01:04:06 UTC 2021


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


Change subject: VTY: fix NULL-pointer dereference in lchan_act_single()
......................................................................

VTY: fix NULL-pointer dereference in lchan_act_single()

Without this guard, a command like this can crash osmo-bsc:

  OsmoBSC# bts 0 trx 0 timeslot 0 sub-slot 0 activate fr

when timeslot 0 is configured as non-combined 'CCCH'.

Change-Id: I0197a6a2595ff9dade58e37383d44d2df3b03288
CLoses: OS#5170
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 4 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 6f4e2ec..89aacf2 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -6060,6 +6060,10 @@
 	if (activate) {
 		LOG_LCHAN(lchan, LOGL_NOTICE, "attempt from VTY to activate lchan %s with codec %s\n",
 			  gsm_lchan_name(lchan), codec_str);
+		if (!lchan->fi) {
+			vty_out(vty, "%% Cannot activate: Channel not initialized%s", VTY_NEWLINE);
+			return CMD_WARNING;
+		}
 
 		int lchan_t;
 		if (lchan->fi->state != LCHAN_ST_UNUSED) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I0197a6a2595ff9dade58e37383d44d2df3b03288
Gerrit-Change-Number: 24540
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/20210604/9709d1f8/attachment.htm>


More information about the gerrit-log mailing list