From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <piotrx.t.azarewicz@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id EBB9BB62
 for <dev@dpdk.org>; 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" <piotrx.t.azarewicz@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
CC: "dev@dpdk.org" <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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=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:
> >  <snip>
> >  > 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