From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B064CA09E4; Thu, 28 Jan 2021 20:12:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2832540682; Thu, 28 Jan 2021 20:12:44 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 4613F4067A; Thu, 28 Jan 2021 20:12:42 +0100 (CET) IronPort-SDR: HmmeIuhulxujKs5W7DxCVlLR35B08tLKssn/LcSQWR4SgWXxc8vq5YwY4FwhlY6Z8AqHO/vRyH LpO2jQ+pi9+Q== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="177733340" X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="177733340" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 11:12:41 -0800 IronPort-SDR: gnDlIZ/B3MJbHYKptf8hdvuTw80uwQeclUDxeIF+xT5CXi7HeW9VEg7OHKQyzvZGUXGg9gbhyo 7bxMvuP5PtwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="363967325" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com) ([10.237.223.107]) by fmsmga008.fm.intel.com with ESMTP; 28 Jan 2021 11:12:40 -0800 From: Cristian Dumitrescu To: dev@dpdk.org Cc: stable@dpdk.org Date: Thu, 28 Jan 2021 19:12:39 +0000 Message-Id: <20210128191239.4354-1-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] examples/pipeline: fix CLI segfault X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Cannot dereference pointer for token[1] unless valid. Fixes: 5074e1d551 ("examples/pipeline: add configuration commands") Cc: stable@dpdk.org Signed-off-by: Cristian Dumitrescu --- examples/pipeline/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c index 3f490854c..cacfb2823 100644 --- a/examples/pipeline/cli.c +++ b/examples/pipeline/cli.c @@ -1420,7 +1420,7 @@ cli_process(char *in, char *out, size_t out_size, void *obj) } if (strcmp(tokens[0], "link") == 0) { - if (strcmp(tokens[1], "show") == 0) { + if ((n_tokens >= 2) && (strcmp(tokens[1], "show") == 0)) { cmd_link_show(tokens, n_tokens, out, out_size, obj); return; } -- 2.17.1