DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kuba Kozak <kubax.kozak@intel.com>
To: declan.doherty@intel.com
Cc: dev@dpdk.org, Kuba Kozak <kubax.kozak@intel.com>
Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix total_ops value validation
Date: Tue,  7 Feb 2017 13:20:16 +0100	[thread overview]
Message-ID: <1486470016-31047-1-git-send-email-kubax.kozak@intel.com> (raw)

Added total_ops value validation in parse_total_ops() function.

Coverity issue: 141070

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
---
 app/test-crypto-perf/cperf_options_parsing.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index 3b7342d..3a8b898 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -128,7 +128,13 @@ struct name_id_map {
 	int ret = parse_uint32_t(&opts->total_ops, arg);
 
 	if (ret)
-		RTE_LOG(ERR, USER1, "failed to parse total operations count");
+		RTE_LOG(ERR, USER1, "failed to parse total operations count\n");
+
+	if (opts->total_ops == 0) {
+		RTE_LOG(ERR, USER1,
+				"invalid total operations count number specified\n");
+		return -1;
+	}
 
 	return ret;
 }
-- 
1.9.1

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.

             reply	other threads:[~2017-02-07 10:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 12:20 Kuba Kozak [this message]
2017-02-09 23:17 ` De Lara Guarch, Pablo
2017-02-09 23:25   ` De Lara Guarch, Pablo

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=1486470016-31047-1-git-send-email-kubax.kozak@intel.com \
    --to=kubax.kozak@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /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).