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

pespin gerrit-no-reply at lists.osmocom.org
Fri Jun 19 16:32:27 UTC 2020


pespin has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/20/18920/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200619/de4a8924/attachment.htm>


More information about the gerrit-log mailing list