s3: Fix vfs_xattr_tdb.c
authorVolker Lendecke <vl@samba.org>
Mon, 21 May 2012 12:41:40 +0000 (14:41 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 21 May 2012 20:10:15 +0000 (22:10 +0200)
"size" is the maximum buffer, only copy what we actually got. For me, this
fixes valgrind errors in the DIR1 test that might potentially make DIR1
non-flaky again.

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon May 21 22:10:15 CEST 2012 on sn-devel-104

source3/modules/vfs_xattr_tdb.c

index ee3199d277bd3ab170e16ebec57b5646043c09e8..fc5c3de6e52c4a6e74b32a7b6ea0649edb860772 100644 (file)
@@ -57,7 +57,7 @@ static ssize_t xattr_tdb_getxattr(struct vfs_handle_struct *handle,
                errno = ERANGE;
                return -1;
        }
-       memcpy(value, blob.data, size);
+       memcpy(value, blob.data, xattr_size);
        return xattr_size;
 }