Change in osmo-trx[master]: proto_trxd: Fix UndefinedBehaviorSanitizer from ubsan

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
Fri Jun 19 20:35:16 UTC 2020


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

Change subject: proto_trxd: Fix UndefinedBehaviorSanitizer from ubsan
......................................................................

proto_trxd: Fix UndefinedBehaviorSanitizer from ubsan

>From UBSan:
proto_trxd.c:65:18: runtime error: 128 is outside the range of representable values of type 'char'.

Fixes: OS#4507
Change-Id: I71f815fe794a00934ee0e876848af56f30a21bfe
---
M Transceiver52M/proto_trxd.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/Transceiver52M/proto_trxd.c b/Transceiver52M/proto_trxd.c
index 5a898b9..fbc0b14 100644
--- a/Transceiver52M/proto_trxd.c
+++ b/Transceiver52M/proto_trxd.c
@@ -62,7 +62,7 @@
 {
 	unsigned i;
 	for (i = 0; i < bi->nbits; i++)
-		soft_bits[i] = (char) round(bi->rx_burst[i] * 255.0);
+		soft_bits[i] = (uint8_t) round(bi->rx_burst[i] * 255.0);
 }
 
 bool trxd_send_burst_ind_v0(size_t chan, int fd, const struct trx_ul_burst_ind *bi) {

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I71f815fe794a00934ee0e876848af56f30a21bfe
Gerrit-Change-Number: 18920
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
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/20200619/12fccd7b/attachment.htm>


More information about the gerrit-log mailing list