diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-07-22 16:09:40 +0200 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2007-07-22 16:09:40 +0200 |
commit | 0343e394510ea3859a5ccb030984b4cdc74281cb (patch) | |
tree | 868537a070699e2600b7c098a77c6aad0470918f | |
parent | 4d840dbb4d5912e419822cbf5b6bd79abe4e2103 (diff) | |
download | lwn-0343e394510ea3859a5ccb030984b4cdc74281cb.tar.gz lwn-0343e394510ea3859a5ccb030984b4cdc74281cb.zip |
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r-- | fs/ntfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 55263b7de9c0..409581aa3eeb 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -135,7 +135,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; } |