From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id EBB9BB62 for ; Tue, 5 Apr 2016 08:58:18 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 04 Apr 2016 23:58:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,443,1455004800"; d="scan'208";a="925583740" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga001.jf.intel.com with ESMTP; 04 Apr 2016 23:58:13 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.19]) by IRSMSX103.ger.corp.intel.com ([169.254.3.239]) with mapi id 14.03.0248.002; Tue, 5 Apr 2016 07:58:12 +0100 From: "Azarewicz, PiotrX T" To: Olivier Matz CC: "dev@dpdk.org" Thread-Topic: [PATCH v1 1/1] cmdline: add any multi string mode to token string Thread-Index: AQHRjApDGHPLeZZNFkmXKiQx2oWojJ95Z1cAgABwSnCAABTsgIABBaqg Date: Tue, 5 Apr 2016 06:58:11 +0000 Message-ID: <4837007523CC9A4B9414D20C13DE6E641368810A@IRSMSX102.ger.corp.intel.com> References: <1459510581-31392-1-git-send-email-piotrx.t.azarewicz@intel.com> <57021F2E.8070306@6wind.com> <4837007523CC9A4B9414D20C13DE6E6413687FDB@IRSMSX102.ger.corp.intel.com> <57028EED.9020008@6wind.com> In-Reply-To: <57028EED.9020008@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v1 1/1] cmdline: add any multi string mode to token string X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2016 06:58:19 -0000 Hi Olivier, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Monday, April 4, 2016 5:58 PM > >> Using token_len + 1 as the buffer size in the snprintf looks a bit > >> dangerous, as it won't protect from overflows. > >> > >> See the following example: > > > > > That's why snprintf() should still use STR_TOKEN_SIZE. > >> > > Okay, I see it. > > But this is a problem that we may need longer string than STR_TOKEN_SIZ= E > in multi token case. > > So what you think about adding new typedef cmdline_multi_string_t for > this case? > > For example: > > #define STR_MULTI_TOKEN_SIZE 1024 > > typedef char cmdline_multi_string_t[STR_MULTI_TOKEN_SIZE]; >=20 > It should do the job, indeed. That's great. We want to set the value of the buffer to 4096, to not to regret in the fut= ure. > By the way, it would be nice to have an example of use. Based on this we plan a lot of changes in ip_pipeline example next release. Regards, Piotr