app/testpmd: fix unintentional integer overflow
PATCH 1/1 app/testpmd: fix unintentional integer overflow
Fix the potential overflow in expression 1 << begin by using 1ULL.
Coverity issue: 279437, 279445
--- app/test-pmd/cmdline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline.c +2 -2
@@ -17739,7 +17739,7 @@ print_rx_offloads(uint64_t offloads) begin =__builtin_ctzll (offloads); end =sizeof (offloads) *CHAR_BIT -__builtin_clzll (offloads); - single_offload =1 << begin; + single_offload =1ULL << begin;for (bit = begin; bit < end; bit++) {if (offloads & single_offload) printf(" %s",
@@ -18133,7 +18133,7 @@ print_tx_offloads(uint64_t offloads) begin =__builtin_ctzll (offloads); end =sizeof (offloads) *CHAR_BIT -__builtin_clzll (offloads); - single_offload =1 << begin; + single_offload =1ULL << begin;for (bit = begin; bit < end; bit++) {if (offloads & single_offload) printf(" %s",
Signature · 1 line
2.17.1
Quoted 9 lines
-----Original Message-----
From: Bie, Tiwei
Sent: Wednesday, April 24, 2019 3:30 AM
To: Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>; Iremonger, Bernard <[email protected]>; [email protected]
Cc: [email protected]
Subject: [PATCH] app/testpmd: fix unintentional integer overflow
Quoted 7 lines
Fix the potential overflow in expression 1 << begin by using 1ULL.
Coverity issue: 279437, 279445
Fixes c73a9071877a ("app/testpmd: add commands to test new offload API")Signed-off-by Tiwei Bie <[email protected]>
Ferruh Yigit
AppliedQuoted 11 lines · Bernard
Quoted 11 lines
-----Original Message-----
From: Bie, Tiwei
Sent: Wednesday, April 24, 2019 3:30 AM
To: Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>; Iremonger, Bernard <[email protected]>; [email protected]
Cc: [email protected]
Subject: [PATCH] app/testpmd: fix unintentional integer overflowFix the potential overflow in expression 1 << begin by using 1ULL.
Quoted 8 lines
Quoted 5 lines
Coverity issue: 279437, 279445
Fixes c73a9071877a ("app/testpmd: add commands to test new offload API")Signed-off-by Tiwei Bie <[email protected]>
Applied to dpdk-next-net/master, thanks.