From: Andrew Morton Date: Thu, 31 May 2007 07:40:49 +0000 (-0700) Subject: ntfs_init_locked_inode(): fix array indexing X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1fc799e1b4efdbc405d87d9f154d64d9bc299e5c;p=openwrt%2Fstaging%2Fblogic.git 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 --- diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 074791ce4ab2..b532a730cec2 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -140,7 +140,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; }