From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 41CA9FAE9 for ; Thu, 9 Feb 2017 23:31:36 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 09 Feb 2017 14:31:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,138,1484035200"; d="scan'208";a="1105362084" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga001.fm.intel.com with ESMTP; 09 Feb 2017 14:31:34 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by irsmsx110.ger.corp.intel.com ([169.254.15.101]) with mapi id 14.03.0248.002; Thu, 9 Feb 2017 22:31:32 +0000 From: "De Lara Guarch, Pablo" To: "Mrozowicz, SlawomirX" , "Doherty, Declan" CC: "dev@dpdk.org" , "Mrozowicz, SlawomirX" Thread-Topic: [dpdk-dev] [PATCH] app/crypto-perf: fix dereference null return value Thread-Index: AQHSgHgMtku5leSHl0C8xjcWqKtLSKFhR1RA Date: Thu, 9 Feb 2017 22:31:31 +0000 Message-ID: References: <1486392910-8183-1-git-send-email-slawomirx.mrozowicz@intel.com> In-Reply-To: <1486392910-8183-1-git-send-email-slawomirx.mrozowicz@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjdiYjhkMTYtNTA2Yi00OTJkLTlhMWQtMmVjNWZmN2UzYTZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InlEWWhWRUpSUjRwME9VandMSzBTN3BRN1lvckczQTRnQ0FZTHVsU3MwV1k9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Thu, 09 Feb 2017 22:31:37 -0000 Hi Slawomir, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir > Mrozowicz > Sent: Monday, February 06, 2017 2:55 PM > To: Doherty, Declan > Cc: dev@dpdk.org; Mrozowicz, SlawomirX > Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix dereference null return > value >=20 > Dereferencing a pointer that might be null key_token when calling strstr. > Check if the pointer is null before. >=20 > Coverity issue: 141071 > Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test > application") >=20 > Signed-off-by: Slawomir Mrozowicz > --- > app/test-crypto-perf/cperf_test_vector_parsing.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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, >=20 > /* get values for key */ > token =3D strtok(NULL, CPERF_ENTRY_DELIMITER); > - if (token =3D=3D NULL) { > + if (key_token =3D=3D NULL || token =3D=3D NULL) { Is this fix right? If key_token is NULL, then I would expect a seg fault he= re. > printf("Expected 'key =3D values' but was '%.40s'..\n", > key_token); > return -1; > -- > 2.5.0 Thanks, Pablo