From: Tiwei Bie <tiwei.bie@intel.com>
To: wenzhuo.lu@intel.com, jingjing.wu@intel.com,
bernard.iremonger@intel.com, dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH] app/testpmd: fix unintentional integer overflow
Date: Wed, 24 Apr 2019 10:29:31 +0800 [thread overview]
Message-ID: <20190424022931.32281-1-tiwei.bie@intel.com> (raw)
Message-ID: <20190424022931.uZK3zG67CUQz9y6yYe0mCI2pQOcc1uHS4D7V5m8Jfiw@z> (raw)
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>
---
app/test-pmd/cmdline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 5a10c5f38..03926f913 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -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",
--
2.17.1
next reply other threads:[~2019-04-24 2:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 2:29 Tiwei Bie [this message]
2019-04-24 2:29 ` Tiwei Bie
2019-04-24 12:41 ` Iremonger, Bernard
2019-04-24 12:41 ` Iremonger, Bernard
2019-04-24 17:01 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-04-24 17:01 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190424022931.32281-1-tiwei.bie@intel.com \
--to=tiwei.bie@intel.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).