diff options
author | Benoît Ganne <bganne@cisco.com> | 2022-08-23 17:05:58 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2022-08-23 17:39:18 +0000 |
commit | a6b2d7ed5a5d20ddb1133da4a153e319151e41e9 (patch) | |
tree | 9f303914f81aea40e1aab7e5302a000ad63d37a2 /src/plugins | |
parent | 174f5c850253bf47f22ce8272d3e321fdf6e5144 (diff) |
rdma: fix coverity 249197
flags is u64, makes sure we do not overflow when shifting.
Type: fix
Change-Id: Ieea34187c0b568dc4d24c9415b9cff36907a5a87
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/rdma/format.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/rdma/format.c b/src/plugins/rdma/format.c index aada52a1ec3..e2bf22512e8 100644 --- a/src/plugins/rdma/format.c +++ b/src/plugins/rdma/format.c @@ -58,13 +58,13 @@ format_rdma_bit_flag (u8 * s, va_list * args) while (flags) { - if ((flags & (1 << i))) + if ((flags & ((u64) 1 << i))) { if (i < n_strs && strs[i] != 0) s = format (s, " %s", strs[i]); else s = format (s, " unknown(%u)", i); - flags ^= 1 << i; + flags ^= (u64) 1 << i; } i++; } |