From: Bruce Richardson <bruce.richardson@intel.com>
To: Radu Nicolau <radu.nicolau@intel.com>
Cc: dev@dpdk.org, john.mcnamara@intel.com, maryam.tahhan@intel.com,
reshma.pattan@intel.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] app/procinfo: fix strncpy count issue
Date: Tue, 20 Feb 2018 13:29:14 +0000 [thread overview]
Message-ID: <20180220132914.GA10780@bricha3-MOBL3.ger.corp.intel.com> (raw)
In-Reply-To: <1519131456-9928-1-git-send-email-radu.nicolau@intel.com>
On Tue, Feb 20, 2018 at 12:57:36PM +0000, Radu Nicolau wrote:
> Change strncpy count parameter to MAX_LONG_OPT_SZ-1 to avoid
> overwriting the last NULL character and for consistency.
>
> Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id")
> Coverity issue: 30688
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
strncpy is a very nasty function that is easy to get wrong. Rather than
fixing it's off by one errors, I think a better fix is to use snprintf
as is done in most other places.
/Bruce
prev parent reply other threads:[~2018-02-20 13:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-20 12:57 Radu Nicolau
2018-02-20 13:00 ` [dpdk-dev] [PATCH v2] " Radu Nicolau
2018-02-20 13:52 ` [dpdk-dev] [PATCH v3] " Radu Nicolau
2018-02-20 14:16 ` Bruce Richardson
2018-03-27 22:25 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-02-20 13:29 ` Bruce Richardson [this message]
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=20180220132914.GA10780@bricha3-MOBL3.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=john.mcnamara@intel.com \
--cc=maryam.tahhan@intel.com \
--cc=radu.nicolau@intel.com \
--cc=reshma.pattan@intel.com \
--cc=stable@dpdk.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).