Messages in this thread Patch in this message | | | Date | Tue, 26 Jan 2016 12:26:11 +0300 | From | Dan Carpenter <> | Subject | [patch] hfs: fix hfs_readdir() |
| |
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;
| |