This could avoid arry bounds exceeded issue.
Signed-off-by: Tiger Yang <[EMAIL PROTECTED]>
---
fs/ocfs2/xattr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 754e5fa..888641d 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -164,7 +164,7 @@ static inline const char *ocfs2_xattr_prefix(int name_index)
{
struct xattr_handler *handler = NULL;
- if (name_index > 0 && name_index < OCFS2_XATTR_MAX)
+ if (name_index > 0 && name_index < ARRAY_SIZE(ocfs2_xattr_handler_map))
handler = ocfs2_xattr_handler_map[name_index];
return handler ? handler->prefix : NULL;
--
1.5.4.1
_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel