Skip to content

Commit

Permalink
ntfs_init_locked_inode(): fix array indexing
Browse files Browse the repository at this point in the history
Local variable `i' is a byte-counter.  Don't use it as an index into an array
of le32's.

Reported-by: "young dave" <[email protected]>
Cc: "Christoph Lameter" <[email protected]>
Acked-by: Anton Altaparmakov <[email protected]>
Cc: <[email protected]>
Cc: Adrian Bunk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and Linus Torvalds committed May 31, 2007
1 parent ebdf7d3 commit 1fc799e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ntfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1fc799e

Please sign in to comment.