From: Tiwei Bie Date: Wed, 24 Apr 2019 02:29:31 +0000 (+0800) Subject: app/testpmd: fix unintentional integer overflow X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8efc716f7cadead969e3ca12c0d9ba2f2aa8a8f6;p=dpdk.git app/testpmd: fix unintentional integer overflow 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") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Acked-by: Bernard Iremonger --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 147a617d53..f45ef8a1c7 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -17833,7 +17833,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", @@ -18227,7 +18227,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",