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>
This commit is contained in:
Andrew Morton 2007-05-31 00:40:49 -07:00 committed by Linus Torvalds
parent ebdf7d399e
commit 1fc799e1b4

View File

@ -140,7 +140,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
if (!ni->name) if (!ni->name)
return -ENOMEM; return -ENOMEM;
memcpy(ni->name, na->name, i); memcpy(ni->name, na->name, i);
ni->name[i] = 0; ni->name[na->name_len] = 0;
} }
return 0; return 0;
} }