summaryrefslogtreecommitdiffstats
path: root/hw/virtio-9p-xattr.c
diff options
context:
space:
mode:
authorKusanagi Kouichi2010-10-30 04:52:39 +0200
committerVenkateswararao Jujjuri (JV)2010-12-03 01:08:27 +0100
commit0562c67432991d1cee442615d70fd39e638bec71 (patch)
tree8bf7c936c1e22af74b8b06f4e4bfbfc877ea7e43 /hw/virtio-9p-xattr.c
parenthw/virtio9p: Use appropriate debug print functions in TLINK path (diff)
downloadqemu-0562c67432991d1cee442615d70fd39e638bec71.tar.gz
qemu-0562c67432991d1cee442615d70fd39e638bec71.tar.xz
qemu-0562c67432991d1cee442615d70fd39e638bec71.zip
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>
Diffstat (limited to 'hw/virtio-9p-xattr.c')
-rw-r--r--hw/virtio-9p-xattr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio-9p-xattr.c b/hw/virtio-9p-xattr.c
index 175f372c39..1aab081de2 100644
--- a/hw/virtio-9p-xattr.c
+++ b/hw/virtio-9p-xattr.c
@@ -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);