mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: franck.jullien@gmail.com
To: barebox@lists.infradead.org
Subject: [PATCH] fs/fat: Initialize local variable finfo
Date: Tue, 15 Nov 2011 23:46:28 +0100	[thread overview]
Message-ID: <1321397188-32451-1-git-send-email-franck.jullien@gmail.com> (raw)
In-Reply-To: <CAJfOKBx4y+6ViUTeZdktAcyYsNvTRaNxdLH3LcYjrE+qYfsGPw@mail.gmail.com>

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.

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

  reply	other threads:[~2011-11-15 22:59 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 ` franck.jullien [this message]
2011-11-17 16:00   ` [PATCH] fs/fat: Initialize local variable finfo Sascha Hauer

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=1321397188-32451-1-git-send-email-franck.jullien@gmail.com \
    --to=franck.jullien@gmail.com \
    --cc=barebox@lists.infradead.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