Change in osmo-bsc[master]: osmo_bsc_bssap: check for conn early

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/.

dexter gerrit-no-reply at lists.osmocom.org
Wed May 13 10:13:51 UTC 2020


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


Change subject: osmo_bsc_bssap: check for conn early
......................................................................

osmo_bsc_bssap: check for conn early

Check the conn pointer in bsc_handle_dt() before dereferencing it.

Change-Id: Ib7bdfa03ee1d186a94720c65dd72a594de21e783
Related: CID#210261
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 5 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 6f5aaa8..72f42eb 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -1220,6 +1220,11 @@
 int bsc_handle_dt(struct gsm_subscriber_connection *conn,
 		  struct msgb *msg, unsigned int len)
 {
+	if (!conn) {
+		LOGP(DMSC, LOGL_ERROR, "No subscriber connection available\n");
+		return -1;
+	}
+
 	log_set_context(LOG_CTX_BSC_SUBSCR, conn->bsub);
 
 	if (len < sizeof(struct bssmap_header)) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib7bdfa03ee1d186a94720c65dd72a594de21e783
Gerrit-Change-Number: 18233
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200513/90dc8f82/attachment.htm>


More information about the gerrit-log mailing list