summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2007-05-31 09:40:49 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-31 16:58:13 +0200
commit1fc799e1b4efdbc405d87d9f154d64d9bc299e5c (patch)
tree39b41ffd8647b3fa0a8262c4e5cb69602d309010 /fs
parentpci-quirks: fix MSI disabling on RS400-200 and RS480 (diff)
downloadlinux-1fc799e1b4efdbc405d87d9f154d64d9bc299e5c.tar.xz
linux-1fc799e1b4efdbc405d87d9f154d64d9bc299e5c.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> 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>
Diffstat (limited to 'fs')
-rw-r--r--fs/ntfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index 074791ce4ab2..b532a730cec2 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -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;
}