From: "Azarewicz, PiotrX T" <piotrx.t.azarewicz@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1 1/1] cmdline: add any multi string mode to token string
Date: Tue, 5 Apr 2016 06:58:11 +0000 [thread overview]
Message-ID: <4837007523CC9A4B9414D20C13DE6E641368810A@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <57028EED.9020008@6wind.com>
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_SIZE
> 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];
>
> 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 future.
> 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
next prev parent reply other threads:[~2016-04-05 6:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 11:36 Piotr Azarewicz
2016-04-04 8:00 ` Olivier Matz
2016-04-04 14:11 ` Azarewicz, PiotrX T
2016-04-04 15:57 ` Olivier Matz
2016-04-05 6:58 ` Azarewicz, PiotrX T [this message]
2016-04-05 8:47 ` [dpdk-dev] [PATCH v2 " Piotr Azarewicz
2016-04-05 11:21 ` Olivier Matz
2016-04-05 15:39 ` Thomas Monjalon
2016-04-15 14:41 ` Wiles, Keith
2016-04-28 14:52 ` Olivier MATZ
2016-04-29 7:14 ` Azarewicz, PiotrX T
2016-04-29 14:29 ` [dpdk-dev] [PATCH v3 " Piotr Azarewicz
2016-05-02 13:32 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4837007523CC9A4B9414D20C13DE6E641368810A@IRSMSX102.ger.corp.intel.com \
--to=piotrx.t.azarewicz@intel.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).