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 46F99A04F2; Thu, 12 Dec 2019 10:14:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BF332BD3; Thu, 12 Dec 2019 10:14:45 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 374B92BC8 for ; Thu, 12 Dec 2019 10:14:42 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 01:14:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,305,1571727600"; d="scan'208";a="203875309" Received: from silpixa00390850.ir.intel.com (HELO silpixa00390850.ger.corp.intel.com) ([10.237.222.84]) by orsmga007.jf.intel.com with ESMTP; 12 Dec 2019 01:14:41 -0800 From: Savinay Dharmappa To: dev@dpdk.org Cc: konstantin.ananyev@intel.com Date: Thu, 12 Dec 2019 09:14:34 +0000 Message-Id: <20191212091435.4398-1-savinay.dharmappa@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] examples/ipsec-secgw: return on encountering algo as NULL 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" if algo is NULL set the status to error and return. Signed-off-by: Savinay Dharmappa --- examples/ipsec-secgw/sa.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 7f046e3ed..c75a5a15f 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -314,6 +314,9 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, APP_CHECK(algo != NULL, status, "unrecognized " "input \"%s\"", tokens[ti]); + if (status->status < 0) + return; + rule->cipher_algo = algo->algo; rule->block_size = algo->block_size; rule->iv_len = algo->iv_len; @@ -378,6 +381,9 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, APP_CHECK(algo != NULL, status, "unrecognized " "input \"%s\"", tokens[ti]); + if (status->status < 0) + return; + rule->auth_algo = algo->algo; rule->auth_key_len = algo->key_len; rule->digest_len = algo->digest_len; @@ -433,6 +439,9 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, APP_CHECK(algo != NULL, status, "unrecognized " "input \"%s\"", tokens[ti]); + if (status->status < 0) + return; + rule->aead_algo = algo->algo; rule->cipher_key_len = algo->key_len; rule->digest_len = algo->digest_len; -- 2.17.1