Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c988fd04 authored by Tiger Yang's avatar Tiger Yang Committed by Mark Fasheh
Browse files

ocfs2: add handler_map array bounds checking



Make the handler_map array as large as the possible value range to avoid
a fencepost error.

[ Utilize alternate method -- Joel ]

Signed-off-by: default avatarTiger Yang <tiger.yang@oracle.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
Signed-off-by: default avatarMark Fasheh <mfasheh@suse.com>
parent ceb1eba3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -78,7 +78,7 @@ struct xattr_handler *ocfs2_xattr_handlers[] = {
	NULL
	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_USER]	= &ocfs2_xattr_user_handler,
	[OCFS2_XATTR_INDEX_TRUSTED]	= &ocfs2_xattr_trusted_handler,
	[OCFS2_XATTR_INDEX_TRUSTED]	= &ocfs2_xattr_trusted_handler,
};
};