Change in osmo-bsc[master]: gsm_lchan_name: assert on NULL lchan

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

pespin gerrit-no-reply at lists.osmocom.org
Wed Dec 9 16:34:18 UTC 2020


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


Change subject: gsm_lchan_name: assert on NULL lchan
......................................................................

gsm_lchan_name: assert on NULL lchan

Steve Langasek <steve.langasek at ubuntu.com> submitted some patches
against downstream osmo-bsc 1.3.0 because some possible null derefences
were detected by the compiler on Ubuntu s390x. Code has eveolved since
then and patch doesn't apply directly anymore, since related code
changed (we now use osmo_count in bsc_subscr_get).
The compiled allegedly claimed some null dereference in gsm_lchan_name.
In general code using that function seems to be doing checks for
existing lchan before calling it, or assuming the lchan pointer is not
null, so I couldn't find any major issue.
However, let's add a OSMO_ASSERT to make sure we can easily identify the
issue if an issue ever happens there, since the gsm_lchan_name should
clearly only be called on non null pointers.

Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387
---
M include/osmocom/bsc/gsm_data.h
1 file changed, 1 insertion(+), 0 deletions(-)



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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 6904266..584c0e6 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -937,6 +937,7 @@
 
 static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
 {
+	OSMO_ASSERT(lchan);
 	return lchan->name;
 }
 

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387
Gerrit-Change-Number: 21637
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201209/ce8535b3/attachment.htm>


More information about the gerrit-log mailing list