DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] cfgfile: fix unitialised buffer and improve reading from nfs filesystem.
Date: Fri, 26 Jun 2015 15:05:17 +0100	[thread overview]
Message-ID: <20150626140516.GA9956@bricha3-MOBL3> (raw)
In-Reply-To: <1435307833-7432-1-git-send-email-danielx.t.mrzyglod@intel.com>

On Fri, Jun 26, 2015 at 10:37:13AM +0200, Daniel Mrzyglod wrote:
> Nature of the problem was not initialised buffer[256] on special condition
> there were probability that program will work on unitialised data that
> could provide unexpected program behaviour.
> 
> Adding additional transparent I/O buffer for I/O operations
> improve reading on heavyloaded enviroments with NFS.
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> ---
>  lib/librte_cfgfile/rte_cfgfile.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c
> index b81c273..88fcb46 100644
> --- a/lib/librte_cfgfile/rte_cfgfile.c
> +++ b/lib/librte_cfgfile/rte_cfgfile.c
> @@ -93,10 +93,14 @@ rte_cfgfile_load(const char *filename, int flags)
>  	int curr_section = -1;
>  	int curr_entry = -1;
>  	char buffer[256];
> +	char f_streambuff[BUFSIZ];
>  	int lineno = 0;
>  	struct rte_cfgfile *cfg = NULL;
> +	memset(buffer, '\0', 256*sizeof(char));
> +	memset(f_streambuff, '\0', BUFSIZ);

Need a blank line before the memsets.
The 256*sizeof(char) needs whitespace around it - however, it's probably best
just replaced by "sizeof(buffer)". For consistency, the same change could be
made to the f_streambuff memset too.

/Bruce

  reply	other threads:[~2015-06-26 14:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26  8:37 Daniel Mrzyglod
2015-06-26 14:05 ` Bruce Richardson [this message]
2015-06-29 14:20 ` [dpdk-dev] [PATCH v2] cfgfile: fix unitialised buffer Daniel Mrzyglod
2015-06-29 14:33   ` Bruce Richardson
2015-06-29 14:32 ` [dpdk-dev] [PATCH] cfgfile: fix unitialised buffer and improve reading from nfs filesystem Mrzyglod, DanielX T
2015-06-29 15:06 ` [dpdk-dev] [PATCH v3] cfgfile: fix unitialised buffer Daniel Mrzyglod
2015-06-29 19:47   ` Dumitrescu, Cristian
2015-07-01 21:36     ` Thomas Monjalon

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=20150626140516.GA9956@bricha3-MOBL3 \
    --to=bruce.richardson@intel.com \
    --cc=danielx.t.mrzyglod@intel.com \
    --cc=dev@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).