aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-21 15:44:52 +0100
committerHarald Welte <laforge@osmocom.org>2020-12-21 15:45:45 +0100
commitc296e2921a616258fbf38018e14fd563084f0fbf (patch)
tree3aa690bc552767f1ffa32f27487a40e063b251eb
parent4eb0f16e252dd76fa7009e85aba0f17fd69f445a (diff)
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
-rw-r--r--src/vty/command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index b38be34e..4825109e 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -727,7 +727,7 @@ static int vty_dump_element(const struct cmd_element *cmd, print_func_t print_fu
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]);