Change in libosmocore[master]: vty: Fix left shifting out of range on signed variable

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
Mon Dec 21 14:45:55 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21820 )


Change subject: vty: Fix left shifting out of range on signed variable
......................................................................

vty: Fix left shifting out of range on signed variable

Fixes following ASan runtime errors while running vty tests:
command.c:730:27: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Somehow we didn't catch this one in Ie11ff18d6fd9f6e1e91a51b6156fb6b0b7d3a9a8

Change-Id: I601caf7daa947f3cf391316f1011007ef9188c90
---
M src/vty/command.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/21820/1

diff --git a/src/vty/command.c b/src/vty/command.c
index b38be34..4825109 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -727,7 +727,7 @@
 			char flag;
 
 			/* Skip attribute if *not* set */
-			if (~cmd->usrattr & (1 << i))
+			if (~cmd->usrattr & ((unsigned)1 << i))
 				continue;
 
 			xml_att_desc = xml_escape(desc[i]);

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I601caf7daa947f3cf391316f1011007ef9188c90
Gerrit-Change-Number: 21820
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201221/c10f0662/attachment.htm>


More information about the gerrit-log mailing list