summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2019-04-24 10:29:31 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-03 18:45:23 +0200
commit8efc716f7cadead969e3ca12c0d9ba2f2aa8a8f6 (patch)
treecda94cc87cecdf593294067acc22e0f7e02065ea /app
parent994e039b953b06a385d4362e1729a150f1a02d77 (diff)
downloaddpdk-8efc716f7cadead969e3ca12c0d9ba2f2aa8a8f6.zip
dpdk-8efc716f7cadead969e3ca12c0d9ba2f2aa8a8f6.tar.gz
dpdk-8efc716f7cadead969e3ca12c0d9ba2f2aa8a8f6.tar.xz
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 <tiwei.bie@intel.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/cmdline.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 147a617..f45ef8a 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",