From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 64D262E8B for ; Tue, 7 Feb 2017 11:27:19 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2017 02:27:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,345,1477983600"; d="scan'208";a="1104098437" Received: from gklab-246-019.igk.intel.com (HELO intel.com) ([10.217.246.19]) by fmsmga001.fm.intel.com with SMTP; 07 Feb 2017 02:27:16 -0800 Received: by intel.com (sSMTP sendmail emulation); Tue, 07 Feb 2017 13:20:50 +0100 From: Kuba Kozak To: declan.doherty@intel.com Cc: dev@dpdk.org, Kuba Kozak Date: Tue, 7 Feb 2017 13:20:16 +0100 Message-Id: <1486470016-31047-1-git-send-email-kubax.kozak@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix total_ops value validation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2017 10:27:20 -0000 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 --- 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.