Change in osmo-bsc[master]: fixup for neighbor config for coverity

neels gerrit-no-reply at lists.osmocom.org
Mon Mar 29 13:12:37 UTC 2021


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


Change subject: fixup for neighbor config for coverity
......................................................................

fixup for neighbor config for coverity

Check against NULL pointers to allow only resolving local or only remote
neighbors in resolve_neighbors(). (Though no caller exists currently
that would need this feature, it is trivial and more future-safe.)

Related: CID#220459 CID#220460
Change-Id: I8c2046335ec6f8a5d6b757446c98d8e630ee015f
---
M src/osmo-bsc/neighbor_ident.c
1 file changed, 4 insertions(+), 2 deletions(-)



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

diff --git a/src/osmo-bsc/neighbor_ident.c b/src/osmo-bsc/neighbor_ident.c
index 263d410..6e70625 100644
--- a/src/osmo-bsc/neighbor_ident.c
+++ b/src/osmo-bsc/neighbor_ident.c
@@ -130,8 +130,10 @@
 	struct gsm_bts *local_neighbor = NULL;
 	struct gsm0808_cell_id_list2 remotes = {};
 
-	*local_neighbor_p = NULL;
-	*remote_neighbors = (struct gsm0808_cell_id_list2){ 0 };
+	if (local_neighbor_p)
+		*local_neighbor_p = NULL;
+	if (remote_neighbors)
+		*remote_neighbors = (struct gsm0808_cell_id_list2){ 0 };
 
 	llist_for_each_entry(n, &from_bts->neighbors, entry) {
 		struct gsm_bts *neigh_bts;

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8c2046335ec6f8a5d6b757446c98d8e630ee015f
Gerrit-Change-Number: 23524
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210329/fbc7ceaf/attachment.htm>


More information about the gerrit-log mailing list