From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B459A04DD for ; Wed, 28 Oct 2020 16:38:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44BB1CC65; Wed, 28 Oct 2020 16:38:22 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 53F9ECBF0; Wed, 28 Oct 2020 16:38:17 +0100 (CET) IronPort-SDR: pwai1NenPwYvq2mSEV9KeCAUw9xKVMYk0SnYVlBNdJkUb/MvL/ZvkraX6RszXDfPtHlqCp/Clm f/8Mp6QUqtMQ== X-IronPort-AV: E=McAfee;i="6000,8403,9788"; a="168377014" X-IronPort-AV: E=Sophos;i="5.77,426,1596524400"; d="scan'208";a="168377014" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2020 08:38:13 -0700 IronPort-SDR: VRCWJl9vKN3pbjp1utXzZAeYD83xMEprzf5wXXNuMV74C/GIP2RUGI0NgkEKOLQE3Wbl1DITdC BsAfvCmPATLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,426,1596524400"; d="scan'208";a="525155764" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.223.148]) by fmsmga006.fm.intel.com with ESMTP; 28 Oct 2020 08:38:11 -0700 From: Ciara Power To: dev@dpdk.org Cc: Ciara Power , marko.kovacevic@intel.com, roy.fan.zhang@intel.com, stable@dpdk.org Date: Wed, 28 Oct 2020 15:38:08 +0000 Message-Id: <20201028153808.103328-1-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] examples/fips_validation: fix checking return value X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The return value was not being checked when calling the get_writeback_data function in the AES test case. On failure, this led to a NULL dereference when using memcpy later. The return value is now checked to avoid this NULL dereference. Coverity issue: 363463 Fixes: cd255ccf5764 ("examples/fips_validation: support AES parsing") Cc: marko.kovacevic@intel.com Cc: roy.fan.zhang@intel.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- examples/fips_validation/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index 07532c9562..bc7abd2b8f 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -1520,7 +1520,9 @@ fips_mct_aes_test(void) return ret; } - get_writeback_data(&val); + ret = get_writeback_data(&val); + if (ret < 0) + return ret; if (info.op == FIPS_TEST_DEC_AUTH_VERIF) memcpy(prev_in, vec.ct.val, AES_BLOCK_SIZE); -- 2.25.1