diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-05-31 00:40:49 -0700 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2007-06-11 11:36:47 -0700 |
commit | c1d644abce8761a681ddf9a0ebe225f93f2bc5a5 (patch) | |
tree | 84ea0f43200a703b6ccdf24c38b747f89b8b6866 | |
parent | 72fec8085df88ab1df41372a34fdfefa72a8936f (diff) | |
download | lwn-c1d644abce8761a681ddf9a0ebe225f93f2bc5a5.tar.gz lwn-c1d644abce8761a681ddf9a0ebe225f93f2bc5a5.zip |
[PATCH] ntfs_init_locked_inode(): fix array indexing
Local variable `i' is a byte-counter. Don't use it as an index into an array
of le32's.
Reported-by: "young dave" <hidave.darkstar@gmail.com>
Cc: "Christoph Lameter" <clameter@sgi.com>
Acked-by: Anton Altaparmakov <aia21@cantab.net>
Cc: <stable@kernel.org>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | fs/ntfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index f8bf8da67ee8..461460d817d9 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -141,7 +141,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na) if (!ni->name) return -ENOMEM; memcpy(ni->name, na->name, i); - ni->name[i] = 0; + ni->name[na->name_len] = 0; } return 0; } |