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

neels gerrit-no-reply at lists.osmocom.org
Thu Apr 8 21:12:49 UTC 2021


neels has submitted this change. ( 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(-)

Approvals:
  dexter: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



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: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210408/f400dd8b/attachment.htm>


More information about the gerrit-log mailing list