From: Phil Yang <Phil.Yang@arm.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "jerinj@marvell.com" <jerinj@marvell.com>,
"skori@marvell.com" <skori@marvell.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"david.marchand@redhat.com" <david.marchand@redhat.com>,
Lijian Zhang <Lijian.Zhang@arm.com>,
Ruifeng Wang <Ruifeng.Wang@arm.com>, nd <nd@arm.com>,
nd <nd@arm.com>
Subject: Re: [dpdk-dev] [PATCH] trace: fix build with gcc 10
Date: Tue, 28 Apr 2020 07:15:40 +0000 [thread overview]
Message-ID: <VE1PR08MB46401F0494BF14CD94060ABAE9AC0@VE1PR08MB4640.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20200427095836.4cc5bbad@hermes.lan>
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, April 28, 2020 12:59 AM
> To: Phil Yang <Phil.Yang@arm.com>
> Cc: jerinj@marvell.com; skori@marvell.com; dev@dpdk.org;
> david.marchand@redhat.com; Lijian Zhang <Lijian.Zhang@arm.com>;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; nd <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH] trace: fix build with gcc 10
>
> On Tue, 28 Apr 2020 00:47:38 +0800
> Phil Yang <phil.yang@arm.com> wrote:
>
> > - if (strlen(optarg) >= size) {
> > + /* the specified trace directory name cannot
> > + * exceed PATH_MAX-1.
> > + */
> > + if (strlen(optarg) >= (size - 1)) {
> > trace_err("input string is too big");
>
> strnlen() is useful for these kinds of cases.
Thanks, Stephen.
I think it checks the dir_name length here, not to trim the input 'optarg'.
So I think the strlen() can handle it correctly.
Thanks,
Phil
next prev parent reply other threads:[~2020-04-28 7:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 16:47 Phil Yang
2020-04-27 16:58 ` Stephen Hemminger
2020-04-28 7:15 ` Phil Yang [this message]
2020-04-28 3:48 ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2020-04-28 7:00 ` Phil Yang
2020-04-28 10:52 ` Sunil Kumar Kori
2020-04-28 13:50 ` Phil Yang
2020-04-28 14:37 ` [dpdk-dev] [PATCH v2] " Phil Yang
2020-04-30 13:51 ` [dpdk-dev] [EXT] " Sunil Kumar Kori
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=VE1PR08MB46401F0494BF14CD94060ABAE9AC0@VE1PR08MB4640.eurprd08.prod.outlook.com \
--to=phil.yang@arm.com \
--cc=Lijian.Zhang@arm.com \
--cc=Ruifeng.Wang@arm.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=nd@arm.com \
--cc=skori@marvell.com \
--cc=stephen@networkplumber.org \
/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).