DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: zhouyangchao <zhouyates@gmail.com>
Cc: dev@dpdk.org, "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	bruce.richardson@intel.com
Subject: Re: [dpdk-dev] [PATCH v2] mem: memory leaks of hubedir caused by strdup
Date: Tue, 17 Apr 2018 13:47:43 +0200	[thread overview]
Message-ID: <1581625.s6OpJcviaZ@xps> (raw)
In-Reply-To: <CABLiTux=ir=D5SDtaegSc9qti9Oy8mKNZdSZGkgbTjnofz5jBA@mail.gmail.com>

I see no reason to accept this patch, replacing strdup by snprintf,
given that we have strlcpy.
Please do a v3 with strlcpy.

17/04/2018 13:16, zhouyangchao:
> As Burakov said, for no other reason, I just followed the old version.
> 
> On Tue, Apr 17, 2018 at 6:31 PM Burakov, Anatoly <anatoly.burakov@intel.com>
> wrote:
> 
> > On 17-Apr-18 11:24 AM, Thomas Monjalon wrote:
> > > 17/04/2018 12:06, Yangchao Zhou:
> > >> Coverity issue: 272585
> > >> Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary")
> > >>
> > >> Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
> > >> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > >
> > > Better to provide a small explanation.
> > >
> > >> -                                    retval = strdup(splitstr[MOUNTPT]);
> > >> +                                    snprintf(hugedir, len, "%s",
> > splitstr[MOUNTPT]);
> > >
> > > I think it is candidate to be replaced by strlcpy.
> > > Please check
> > >
> >
> > Yes, it seems that strlcpy thingie was merged without much fanfare. I'll
> > be submitting a patch fixing various usages of snprintf in my recent
> > commits. I'm inclined to leave this as is for this commit, as it's not
> > the purpose of this fix.

  reply	other threads:[~2018-04-17 11:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17  9:43 [dpdk-dev] [PATCH] " Yangchao Zhou
2018-04-17  9:57 ` Burakov, Anatoly
2018-04-17 10:06   ` [dpdk-dev] [PATCH v2] " Yangchao Zhou
2018-04-17 10:24     ` Thomas Monjalon
2018-04-17 10:31       ` Burakov, Anatoly
2018-04-17 11:16         ` zhouyangchao
2018-04-17 11:47           ` Thomas Monjalon [this message]
2018-04-17 14:02             ` Burakov, Anatoly
2018-04-18  3:09               ` [dpdk-dev] [PATCH v3] mem: fix memory leaks of hugedir and replace snprintf Yangchao Zhou
2018-04-18  9:00                 ` Thomas Monjalon
2018-04-18  9:25                   ` Burakov, Anatoly

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=1581625.s6OpJcviaZ@xps \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=zhouyates@gmail.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).