DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Roman Korynkevych <romanx.korynkevych@intel.com>,
	maryam.tahhan@intel.com, reshma.pattan@intel.com
Cc: dev@dpdk.org, harry.van.haaren@intel.com
Subject: Re: [dpdk-dev] [PATCH v1 1/1] app/procinfo: buffer null termination fix.
Date: Sat, 06 May 2017 11:03:47 +0200	[thread overview]
Message-ID: <2111266.yHnu9HNQaI@xps> (raw)
In-Reply-To: <1492787196-9101-1-git-send-email-romanx.korynkevych@intel.com>

21/04/2017 17:06, Roman Korynkevych:
> Coverity issue: 143252
> Fixes: 2deb6b5246d7706448d070335b329d1acb754cee ("app/procinfo: add collectd format and host id")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Roman Korynkevych <romanx.korynkevych@intel.com>
> ---
>  app/proc_info/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/proc_info/main.c b/app/proc_info/main.c
> index 16b27b2..97d0352 100644
> --- a/app/proc_info/main.c
> +++ b/app/proc_info/main.c
> @@ -189,7 +189,7 @@ proc_info_preparse_args(int argc, char **argv)
>  				proc_info_usage(prgname);
>  				return -1;
>  			}
> -			strncpy(host_id, argv[i+1], sizeof(host_id));
> +			strncpy(host_id, argv[i+1], sizeof(host_id)-1);

The full array size should be given to strncpy.
However, the call to gethostname below seems wrong as
it does not use the full size.

Maryam, Reshma,
Please review the procinfo patches.

  reply	other threads:[~2017-05-06  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 15:06 Roman Korynkevych
2017-05-06  9:03 ` Thomas Monjalon [this message]
2017-05-07 20:18   ` Bruce Richardson

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=2111266.yHnu9HNQaI@xps \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=maryam.tahhan@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=romanx.korynkevych@intel.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).