]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] ntfs_init_locked_inode(): fix array indexing
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 31 May 2007 07:40:49 +0000 (00:40 -0700)
committerChris Wright <chrisw@sous-sol.org>
Mon, 11 Jun 2007 18:36:47 +0000 (11:36 -0700)
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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ntfs/inode.c

index f8bf8da67ee8f86bb0813b231f55ddbfc5148a46..461460d817d9bc4d281e39f491601a1881cc8a82 100644 (file)
@@ -141,7 +141,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;
 }