lkml.org 
[lkml]   [2016]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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;
\
 
 \ /
  Last update: 2016-01-26 10:41    [W:0.080 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site