DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Yangchao Zhou <zhouyates@gmail.com>
Cc: dev@dpdk.org, 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 12:24:42 +0200	[thread overview]
Message-ID: <1581620.t7eghVUmVK@xps> (raw)
In-Reply-To: <1523959561-17400-1-git-send-email-zhouyates@gmail.com>

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

  reply	other threads:[~2018-04-17 10:24 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 [this message]
2018-04-17 10:31       ` Burakov, Anatoly
2018-04-17 11:16         ` zhouyangchao
2018-04-17 11:47           ` Thomas Monjalon
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=1581620.t7eghVUmVK@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).