]> Git Repo - linux.git/commitdiff
ocfs2: add handler_map array bounds checking
authorTiger Yang <[email protected]>
Thu, 23 Oct 2008 08:34:44 +0000 (16:34 +0800)
committerMark Fasheh <[email protected]>
Mon, 10 Nov 2008 17:51:44 +0000 (09:51 -0800)
Make the handler_map array as large as the possible value range to avoid
a fencepost error.

[ Utilize alternate method -- Joel ]

Signed-off-by: Tiger Yang <[email protected]>
Signed-off-by: Joel Becker <[email protected]>
Signed-off-by: Mark Fasheh <[email protected]>
fs/ocfs2/xattr.c

index a9da45bbb9ed9797dad1311dfe4df66a1a7aaf28..e19980a71a3c418e8eb70f3ea3529762223dbf58 100644 (file)
@@ -78,7 +78,7 @@ struct xattr_handler *ocfs2_xattr_handlers[] = {
        NULL
 };
 
-static struct xattr_handler *ocfs2_xattr_handler_map[] = {
+static struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = {
        [OCFS2_XATTR_INDEX_USER]        = &ocfs2_xattr_user_handler,
        [OCFS2_XATTR_INDEX_TRUSTED]     = &ocfs2_xattr_trusted_handler,
 };
This page took 0.059239 seconds and 4 git commands to generate.