From: Andrew Morton Date: Thu, 31 May 2007 07:40:49 +0000 (-0700) Subject: ntfs_init_locked_inode(): fix array indexing X-Git-Tag: v2.6.22-rc4~78 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fc799e1b4efdbc405d87d9f154d64d9bc299e5c;p=linux-2.6 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 074791ce4a..b532a730ce 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; }