Change in osmo-pcu[master]: Fix: left shift cannot be repesented in type int

pespin gerrit-no-reply at lists.osmocom.org
Thu Mar 25 11:36:25 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/23486 )

Change subject: Fix: left shift cannot be repesented in type int
......................................................................

Fix: left shift cannot be repesented in type int

Caught by ASan:
runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Change-Id: I30aed795d027dc063f06e08c8455bad2dd92cf24
---
M src/pcu_vty.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index c2de92c..abc3d8d 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -239,7 +239,7 @@
 		vty_out(vty, " pcu-socket %s%s", the_pcu->pcu_sock_path, VTY_NEWLINE);
 
 	for (i = 0; i < 32; i++) {
-		unsigned int cs = (1 << i);
+		uint32_t cs = ((uint32_t)1 << i);
 		if (the_pcu->gsmtap_categ_mask & cs) {
 			vty_out(vty, " gsmtap-category %s%s",
 				get_value_string(pcu_gsmtap_categ_names, i), VTY_NEWLINE);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I30aed795d027dc063f06e08c8455bad2dd92cf24
Gerrit-Change-Number: 23486
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy 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/20210325/82dacf1c/attachment.htm>


More information about the gerrit-log mailing list