Commit 1fc799e1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

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: default avatar"young dave" <>
Cc: "Christoph Lameter" <>
Acked-by: default avatarAnton Altaparmakov <>
Cc: <>
Cc: Adrian Bunk <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent ebdf7d39
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment