mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: franck.jullien@gmail.com
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] fs/fat: Initialize local variable finfo
Date: Thu, 17 Nov 2011 17:00:20 +0100	[thread overview]
Message-ID: <20111117160020.GM27267@pengutronix.de> (raw)
In-Reply-To: <1321397188-32451-1-git-send-email-franck.jullien@gmail.com>

On Tue, Nov 15, 2011 at 11:46:28PM +0100, franck.jullien@gmail.com wrote:
> From: Franck Jullien <franck.jullien@gmail.com>
> 
> fat_stat in fs/fat.c declares finfo but doesn't initialize it.
> When get_fileinfo is called, fno->lfname and fno->lfsize are
> tested but haven't been zeroed...This can lead to a wrong
> behavior.

Applied to -master.

Thanks
 Sascha

> 
> Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
> ---
>  fs/fat/fat.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
> index 4219801..8420f3a 100644
> --- a/fs/fat/fat.c
> +++ b/fs/fat/fat.c
> @@ -354,6 +354,8 @@ static int fat_stat(struct device_d *dev, const char *filename, struct stat *s)
>  	FILINFO finfo;
>  	int ret;
>  
> +	memset(&finfo, 0, sizeof(FILINFO));
> +
>  	ret = f_stat(&priv->fat, filename, &finfo);
>  	if (ret)
>  		return ret;
> -- 
> 1.7.7
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2011-11-17 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 20:18 Problem with long files name in FAT Franck JULLIEN
2011-11-15 22:46 ` [PATCH] fs/fat: Initialize local variable finfo franck.jullien
2011-11-17 16:00   ` Sascha Hauer [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=20111117160020.GM27267@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=franck.jullien@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