summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/orangefs/protocol.h2
-rw-r--r--fs/orangefs/xattr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/orangefs/protocol.h b/fs/orangefs/protocol.h
index 50578a2..a7f21a3 100644
--- a/fs/orangefs/protocol.h
+++ b/fs/orangefs/protocol.h
@@ -74,8 +74,8 @@ static inline void ORANGEFS_khandle_to(const struct orangefs_khandle *kh,
void *p, int size)
{
- memset(p, 0, size);
memcpy(p, kh->u, 16);
+ memset(p + 16, 0, size - 16);
}
diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c
index 90a8ae7..63a6280d 100644
--- a/fs/orangefs/xattr.c
+++ b/fs/orangefs/xattr.c
@@ -142,8 +142,8 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *prefix,
goto out_release_op;
}
- memset(buffer, 0, size);
memcpy(buffer, new_op->downcall.resp.getxattr.val, length);
+ memset(buffer + length, 0, size - length);
gossip_debug(GOSSIP_XATTR_DEBUG,
"orangefs_inode_getxattr: inode %pU "
"key %s key_sz %d, val_len %d\n",
OpenPOWER on IntegriCloud