Change in osmo-bsc[master]: paging: fix nullpointer deref

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jan 14 10:02:17 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12482 )

Change subject: paging: fix nullpointer deref
......................................................................

paging: fix nullpointer deref

In theroy the function T_def_get_entry() may return a nullpointer. In
this case we would run straight into a nullpointer dereference problem.
However, the requested timer is statically defined and should always be
there. However Coverity still reports this as a problem. Lets put an
OSMO_ASSERT to make clear that there is no problem here.

Fixes: CID#190403
Change-Id: If5238132d9d5a1507b9955a0b2dc4b1bced220e8
---
M src/osmo-bsc/paging.c
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 2c9d5cd..066db1c 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -296,6 +296,11 @@
 	unsigned int to_us, to;
 	struct T_def *d = T_def_get_entry(bts->network->T_defs, 3113);
 
+	/* Note: d should always contain a valid pointer since all timers,
+	 * including 3113 are statically pre-defined in
+	 * struct T_def gsm_network_T_defs. */
+	OSMO_ASSERT(d);
+
 	if (!bts->T3113_dynamic)
 		return d->val;
 

-- 
To view, visit https://gerrit.osmocom.org/12482
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If5238132d9d5a1507b9955a0b2dc4b1bced220e8
Gerrit-Change-Number: 12482
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190114/5ef82893/attachment.htm>


More information about the gerrit-log mailing list