virtio-9p: Check the return value of llistxattr.

If llistxattr returned 0, qemu aborts.

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
This commit is contained in:
Kusanagi Kouichi 2010-10-30 11:52:39 +09:00 committed by Venkateswararao Jujjuri (JV)
parent d04e2826f5
commit 0562c67432

View file

@ -73,6 +73,9 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
/* Get the actual len */
xattr_len = llistxattr(rpath(ctx, path), value, 0);
if (xattr_len <= 0) {
return xattr_len;
}
/* Now fetch the xattr and find the actual size */
orig_value = qemu_malloc(xattr_len);