Skip to content

Commit 1fc799e

Browse files
akpm00Linus Torvalds
authored andcommitted
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>
1 parent ebdf7d3 commit 1fc799e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/ntfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
140140
if (!ni->name)
141141
return -ENOMEM;
142142
memcpy(ni->name, na->name, i);
143-
ni->name[i] = 0;
143+
ni->name[na->name_len] = 0;
144144
}
145145
return 0;
146146
}

0 commit comments

Comments
 (0)