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 F1795A0546; Tue, 25 May 2021 16:01:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D23F40150; Tue, 25 May 2021 16:01:32 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2049.outbound.protection.outlook.com [40.107.101.49]) by mails.dpdk.org (Postfix) with ESMTP id 6AD504003F; Tue, 25 May 2021 16:01:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ut43hqcCpFpA1XD2KM903MOfFFgVco1j/1KZt2YwNdANmsbXNxlR2fYbks1uYlbQaDcXCHPe0F/k5aaa+6XW1hNyIQphp0LlTt1S4QzbJEGthGqbT++dJESH7iFaKr2IYJDQqZHP89qYKQ+g5zcCNNL6r1VSy1s53+vGFQHu1NLxqbx5M7oGJbHjjoNkZzj/bkuoIcXB4p/Up11b4zl163XbtHHPAoYjhFVfIYpSg6DptEsdeUy2jkapxE69KYQ07+/tTN18U3vPv1drjy7X66SxVkiqtrlqVnGEVDLOBhUjZlpppTj4BPpnL2nXAqOsSunnFBJQuSkmhESDo6DnDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aVvd61tPmwxm0Oujq9WiT1yIqNpMsIa7cQ1fxpHMexw=; b=Cu979kI6zqyEkNK8B5xOOln5AA+4sygfRWbB9aimnW5ItCH5uzijgUSKgbnTBnQQl4tWvOy5cB/K1Dg9CRNBPNGbdli+mb/2koRkILzIZHhefADdItOA24XCWDqwRhXJQCw+xnD4DdCLredGDP9jDAk2H75vAM08mLgOYuP+laNzhfEznEM+W00PSYN6hOEYkHCvWOyjnwl/4se/fMsBpjLg+clqtoTqq7u2+W2VMLes0NpqTu2e+0VmEIUGkdFVvuTfIJXX1E6WBC1kcxanisckj4J73NUXTl2jYMHX1/J7Y0sGqO04kiRDHqz03T663Q74Ks5bIrTNdMMYOXLQiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aVvd61tPmwxm0Oujq9WiT1yIqNpMsIa7cQ1fxpHMexw=; b=L9bF602etbplr1xXBZuz8O+V1NsuvML/6Gp2b+Fha0rJbvj2dzhF4dVN6pyZULdnqcHVf9gYz8kj9MXr/A8MIDaVpkOevIxzcAmNKpUpCrrMT2aWq5tt9Ezj3FhyxQHuKvLbsB1uxEg94i9QRnCmjLw6Ymj7Af7UDSdHH/lJ8d0VEWzgBGfmzvzvPpsZRl2u9wtVn0rvQaUjn/G9v5471rM822y6BEmIneZuwyU9ONU1SZhOz/6MVQxkfBt3SBAK+HAgYDaFG/EGcMjTZblEKVHZwQnbKIQE6ZYXT8N9Bjuw/j3DQzbMVBeDnIuly/4HZ71vOX7UBiH6KLnXxPv6uQ== Received: from CH0PR12MB5041.namprd12.prod.outlook.com (2603:10b6:610:e0::16) by CH2PR12MB5564.namprd12.prod.outlook.com (2603:10b6:610:65::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Tue, 25 May 2021 14:01:30 +0000 Received: from CH0PR12MB5041.namprd12.prod.outlook.com ([fe80::4051:6d8:dfa6:e554]) by CH0PR12MB5041.namprd12.prod.outlook.com ([fe80::4051:6d8:dfa6:e554%7]) with mapi id 15.20.4173.020; Tue, 25 May 2021 14:01:30 +0000 From: Bing Zhao To: Thierry Herbelot , "dev@dpdk.org" CC: NBU-Contact-Thomas Monjalon , "stable@dpdk.org" , Ori Kam Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: do not use a possibly NULL Pointer Thread-Index: AQHXUHtx+gxNlJwkaU6BCo1xwutiOKr0Nh7g Date: Tue, 25 May 2021 14:01:30 +0000 Message-ID: References: <20210524090144.16908-1-thierry.herbelot@6wind.com> In-Reply-To: <20210524090144.16908-1-thierry.herbelot@6wind.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [39.183.11.74] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8822e7b4-d372-4292-5c6a-08d91f8598a7 x-ms-traffictypediagnostic: CH2PR12MB5564: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MlUXMjXzETBG9PeqxbCo0xXAX7m7TeB2y/ECUZENwC8ziLbgoKkKaitEuwLbEjaou0N/o2huBvfYakw7c754g82oVywTdLuE9uOAygrAjhdH5U6N2g9+BB2FLIrzh4oFTDjIEoJLDThvKJy0iFbEmJaEkCoZN5ipCTtlJP5tLz15rKPUqEfOwl5kU9vFMMGHBv6iNe7vhZaPZQGEBWhnxMGj4wvynQ6d/os7/TyYcK6CFBJ6JheMUT8JG00K2uDK0aBb4jWwzFG1aYNwuBJrhzxmO+GXPhUuS/2Z3W2zSfNqc4PfU8K0g9Z+ya5m1nv4P7BbbY+gPytpXon885+eQEr7masonIQ3uYlutz//qk4T/N7oog9Ae+R6XPd3bUsO00nbYjGviiEYljLcDPNgDXJJ7ACkoO/GlDWxqHBpElZJcdPuK/qvOdpT1rF48lC3oBwrs9t8fmWHKTEBocfeMSDa84KTIJiB9mLdIoCEy8boy/HJeW9a1MdWAQ5HLZ/YUizFtrUAI/BIDiuWFdWBaeKS8nyXS3M0NYz0eq1GraWTF1RbQ2r9YFY154v4JAKPxkaT8hGIexekjlfasnNJMSDf+qm5PFQFKMAv17ciiOo= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR12MB5041.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(376002)(396003)(39860400002)(366004)(33656002)(76116006)(107886003)(83380400001)(64756008)(66946007)(66446008)(66556008)(66476007)(8676002)(8936002)(55016002)(2906002)(122000001)(38100700002)(52536014)(54906003)(4326008)(71200400001)(316002)(110136005)(5660300002)(478600001)(6506007)(9686003)(86362001)(53546011)(7696005)(186003)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?UFsipWXG5fWaiKNNu0t/onVoP5sG8sXj+BbbAHPH4HTiai/tY/ZWFtGVR5lH?= =?us-ascii?Q?5lDFS+2h6ebhIHVDjbxHXOwqPrrpyThT3wA7lRWnW6ICUyunAjnYM/n6dOB8?= =?us-ascii?Q?14rLvsSRzl34HJaeiJyTueezz1K7jfLbd/BnwDBE1Y8u0NBDm67uL05vDNsD?= =?us-ascii?Q?XvbfQj+UTgxZl23b1LeFK7Ur7n7sWlVnVkN70SUmkaM9XSMkLXrPzGJk6NZ7?= =?us-ascii?Q?RVZaHZ6r05F3zsjxlJuuirhiHq6AQJzuUFI2viIoFwXvtJ0aJ+2tbz7MvOiX?= =?us-ascii?Q?Pe1IGfHW7Z04SMAcFVFJ0ZNaYm0aj0q82T8Qqv4Eh92uXp34eUZ6LpbEBSV0?= =?us-ascii?Q?edo4ssC6Vd3vtsxfoVGAuxUgP8eAz2173t+IBr6J50RXpofvUbPWMaaneQfk?= =?us-ascii?Q?BNY2NVjVKvF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iwMJ?= =?us-ascii?Q?ApUZfp+tcaqThUTVn5GZ6zzT?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR12MB5041.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8822e7b4-d372-4292-5c6a-08d91f8598a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 May 2021 14:01:30.0816 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LCFOTPMzD68cmFhseRElS15KDgv/wS8yfcScYrqINurZwjcN4+kDUKcPcVoKUCuHEELeKkh85EOzE596ZnWc6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5564 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: do not use a possibly NULL Pointer 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" Hi Thierry, > -----Original Message----- > From: dev On Behalf Of Thierry Herbelot > Sent: Monday, May 24, 2021 5:02 PM > To: dev@dpdk.org > Cc: Thierry Herbelot ; NBU-Contact- > Thomas Monjalon ; stable@dpdk.org; Ori Kam > > Subject: [dpdk-dev] [PATCH] app/testpmd: do not use a possibly NULL > Pointer >=20 > External email: Use caution opening links or attachments >=20 >=20 > Use out only after it was checked not to be NULL. >=20 > Fixes: 4d07cbefe3ba0 ("app/testpmd: add commands for conntrack") > Cc: stable@dpdk.org > Cc: Ori Kam >=20 > Signed-off-by: Thierry Herbelot > --- > app/test-pmd/cmdline_flow.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test- > pmd/cmdline_flow.c > index 1c587bb7b803..7645b3cc90a1 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -6631,10 +6631,10 @@ parse_vc_action_conntrack_update(struct > context *ctx, const struct token *token, > /* Token name must match. */ > if (parse_default(ctx, token, str, len, NULL, 0) < 0) > return -1; > - ct_modify =3D (struct rte_flow_modify_conntrack *)out- > >args.vc.data; > /* Nothing else to do if there is no buffer. */ > if (!out) > return len; > + ct_modify =3D (struct rte_flow_modify_conntrack *)out- > >args.vc.data; Thanks. Will there be a segment fault if an auto-completion is done by using "tab"? > if (ctx->curr =3D=3D ACTION_CONNTRACK_UPDATE_DIR) { > ct_modify->new_ct.is_original_dir =3D > conntrack_context.is_original_dir; > -- > 2.29.2 Reviewed-by: Bing Zhao