virtio-9p: Check the return value of llistxattr.
authorKusanagi Kouichi <slash@ac.auone-net.jp>
Sat, 30 Oct 2010 02:52:39 +0000 (11:52 +0900)
committerVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Fri, 3 Dec 2010 00:08:27 +0000 (16:08 -0800)
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>
hw/virtio-9p-xattr.c

index 175f372c39560ae191d0850adce4bcf41568bde0..1aab081de2ab7ce2883ed6250a668f7382e7f66d 100644 (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);