Change in osmo-bsc[master]: bts_unknown: fix: properly initialize the feature vector

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

laforge gerrit-no-reply at lists.osmocom.org
Sun May 31 18:44:29 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18607 )

Change subject: bts_unknown: fix: properly initialize the feature vector
......................................................................

bts_unknown: fix: properly initialize the feature vector

This is unlikely to cause any problems, but having a NULL-pointer
that can potentially be dereferenced is dangerous. Fix this.

Change-Id: Icf594604f69023d1483e897edb811e51774b5b8e
---
M src/osmo-bsc/bts_unknown.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/bts_unknown.c b/src/osmo-bsc/bts_unknown.c
index 5ecf875..b6b56a8 100644
--- a/src/osmo-bsc/bts_unknown.c
+++ b/src/osmo-bsc/bts_unknown.c
@@ -36,5 +36,11 @@
 
 int bts_model_unknown_init(void)
 {
+	/* NOTE: the buffer is zero-initialized by compiler */
+	model_unknown.features = (struct bitvec) {
+		.data_len = sizeof(model_unknown._features_data),
+		.data = &model_unknown._features_data[0],
+	};
+
 	return gsm_bts_model_register(&model_unknown);
 }

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icf594604f69023d1483e897edb811e51774b5b8e
Gerrit-Change-Number: 18607
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200531/db1d7148/attachment.htm>


More information about the gerrit-log mailing list