From c1d644abce8761a681ddf9a0ebe225f93f2bc5a5 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 31 May 2007 00:40:49 -0700 Subject: [PATCH] [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" Cc: "Christoph Lameter" Acked-by: Anton Altaparmakov Cc: Cc: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- fs/ntfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5