From: Tiger Yang Date: Thu, 23 Oct 2008 08:34:44 +0000 (+0800) Subject: ocfs2: add handler_map array bounds checking X-Git-Tag: v2.6.28-rc5~82^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c988fd045f1195e62c0970384903ab9da26a9359;p=linux-2.6-omap-h63xx.git 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: Tiger Yang Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh --- diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index a9da45bbb9e..e19980a71a3 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -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, };