hw/9pfs/virtio-9p-posix-acl: Fix out-of-bounds access
authorShannon Zhao <zhaoshenglong@huawei.com>
Fri, 13 Mar 2015 05:48:07 +0000 (13:48 +0800)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Fri, 13 Mar 2015 08:31:24 +0000 (14:01 +0530)
It's detected by coverity. Fix out-of-bounds access of the function mp_dacl_listxattr.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs/virtio-9p-posix-acl.c

index 803d9d94f3b8ff141933111c2bf21c94303889c7..09dad071e487da69d14a7e229851c82ba5700200 100644 (file)
@@ -114,7 +114,7 @@ static ssize_t mp_dacl_listxattr(FsContext *ctx, const char *path,
     }
 
     /* len includes the trailing NUL */
-    memcpy(value, ACL_ACCESS, len);
+    memcpy(value, ACL_DEFAULT, len);
     return 0;
 }