Change in ...osmo-pcu[master]: gprs_bssgp_destroy(): fix 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
Fri Aug 23 16:30:31 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/15281


Change subject: gprs_bssgp_destroy(): fix NULL-pointer dereference
......................................................................

gprs_bssgp_destroy(): fix NULL-pointer dereference

The 'gprs_bssgp_pcu' may not be initialized in some cases, e.g.
when OsmoPCU is terminated before connecting to the SGSN.

Change-Id: I42cb911a679b9198fd06e74b42f1e2cb28323de9
---
M src/gprs_bssgp_pcu.cpp
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/81/15281/1

diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index ddf5174..ade9879 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -975,7 +975,8 @@
 	gprs_ns_destroy(nsi);
 
 	/* FIXME: move this to libgb: btsctx_free() */
-	llist_del(&the_pcu.bctx->list);
+	if (the_pcu.bctx != NULL)
+		llist_del(&the_pcu.bctx->list);
 #warning "This causes ASAN to complain. It is not critical for normal operation but should be fixed nevertheless"
 #if 0
 	talloc_free(the_pcu.bctx);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I42cb911a679b9198fd06e74b42f1e2cb28323de9
Gerrit-Change-Number: 15281
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190823/ae7a216b/attachment.htm>


More information about the gerrit-log mailing list