aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/xattr.c')
-rw-r--r--fs/reiserfs/xattr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index ff94fad477e4..48cdfc81fe10 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -792,8 +792,10 @@ static int listxattr_filler(struct dir_context *ctx, const char *name,
792 return 0; 792 return 0;
793 size = namelen + 1; 793 size = namelen + 1;
794 if (b->buf) { 794 if (b->buf) {
795 if (size > b->size) 795 if (b->pos + size > b->size) {
796 b->pos = -ERANGE;
796 return -ERANGE; 797 return -ERANGE;
798 }
797 memcpy(b->buf + b->pos, name, namelen); 799 memcpy(b->buf + b->pos, name, namelen);
798 b->buf[b->pos + namelen] = 0; 800 b->buf[b->pos + namelen] = 0;
799 } 801 }