From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id E98F05A44 for ; Mon, 6 Feb 2017 13:53:14 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 06 Feb 2017 04:53:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,342,1477983600"; d="scan'208";a="1122697155" Received: from gklab-246-019.igk.intel.com (HELO intel.com) ([10.217.246.19]) by fmsmga002.fm.intel.com with SMTP; 06 Feb 2017 04:53:11 -0800 Received: by intel.com (sSMTP sendmail emulation); Mon, 06 Feb 2017 15:55:12 +0100 From: Slawomir Mrozowicz To: declan.doherty@intel.com Cc: dev@dpdk.org, Slawomir Mrozowicz Date: Mon, 6 Feb 2017 15:55:10 +0100 Message-Id: <1486392910-8183-1-git-send-email-slawomirx.mrozowicz@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix dereference null return value 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: Mon, 06 Feb 2017 12:53:15 -0000 Dereferencing a pointer that might be null key_token when calling strstr. Check if the pointer is null before. Coverity issue: 141071 Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application") Signed-off-by: Slawomir Mrozowicz --- app/test-crypto-perf/cperf_test_vector_parsing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c index e0bcb20..a7d7b51 100644 --- a/app/test-crypto-perf/cperf_test_vector_parsing.c +++ b/app/test-crypto-perf/cperf_test_vector_parsing.c @@ -240,7 +240,7 @@ parse_entry(char *entry, struct cperf_test_vector *vector, /* get values for key */ token = strtok(NULL, CPERF_ENTRY_DELIMITER); - if (token == NULL) { + if (key_token == NULL || token == NULL) { printf("Expected 'key = values' but was '%.40s'..\n", key_token); return -1; -- 2.5.0