linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] hfs: fix hfs_readdir()
@ 2016-01-26  9:26 Dan Carpenter
  2016-01-26 18:18 ` Viacheslav Dubeyko
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2016-01-26  9:26 UTC (permalink / raw)
  To: Chengyu Song
  Cc: Andrew Morton, David Howells, Al Viro, linux-fsdevel,
	linux-kernel, kernel-janitors

I was looking through static analysis warnings and we seem to be copying
garbage into &rd->key.  This goes back to before the start of git...

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Not tested.  Please review carefully.

diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 70788e0..66485d7 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -163,7 +163,7 @@ static int hfs_readdir(struct file *file, struct dir_context *ctx)
 		rd->file = file;
 		list_add(&rd->list, &HFS_I(inode)->open_dir_list);
 	}
-	memcpy(&rd->key, &fd.key, sizeof(struct hfs_cat_key));
+	memcpy(&rd->key, &fd.key->cat, sizeof(struct hfs_cat_key));
 out:
 	hfs_find_exit(&fd);
 	return err;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-16 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26  9:26 [patch] hfs: fix hfs_readdir() Dan Carpenter
2016-01-26 18:18 ` Viacheslav Dubeyko
2016-01-26 19:18   ` Dan Carpenter
2016-01-26 21:54     ` Viacheslav Dubeyko
2017-01-16 14:22       ` Dan Carpenter
2017-01-16 22:34         ` Viacheslav Dubeyko

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).