Change in ...osmo-ggsn[master]: ggsn: Fix undefined behaviour shifting beyond sign bit

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jun 4 08:43:03 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14287 )

Change subject: ggsn: Fix undefined behaviour shifting beyond sign bit
......................................................................

ggsn: Fix undefined behaviour shifting beyond sign bit

Fixes following ASan complaint during VTY "show running-config":
osmo-ggsn/ggsn/ggsn_vty.c:657:37: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Change-Id: I2b8d163dbc108b0fb5a1e820dc23181835d12869
---
M ggsn/ggsn_vty.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c
index 3f012d2..9101361 100644
--- a/ggsn/ggsn_vty.c
+++ b/ggsn/ggsn_vty.c
@@ -654,9 +654,9 @@
 		vty_out(vty, "  ipdown-script %s%s", apn->tun.cfg.ipdown_script, VTY_NEWLINE);
 
 	for (i = 0; i < 32; i++) {
-		if (!(apn->cfg.apn_type_mask & (1 << i)))
+		if (!(apn->cfg.apn_type_mask & (UINT32_C(1) << i)))
 			continue;
-		vty_out(vty, "  type-support %s%s", get_value_string(pdp_type_names, (1 << i)),
+		vty_out(vty, "  type-support %s%s", get_value_string(pdp_type_names, (UINT32_C(1) << i)),
 			VTY_NEWLINE);
 	}
 

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

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I2b8d163dbc108b0fb5a1e820dc23181835d12869
Gerrit-Change-Number: 14287
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190604/1c542ba9/attachment.html>


More information about the gerrit-log mailing list