From: Kusanagi Kouichi Date: Sat, 30 Oct 2010 02:52:39 +0000 (+0900) Subject: virtio-9p: Check the return value of llistxattr. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0562c67432991d1cee442615d70fd39e638bec71;p=qemu.git virtio-9p: Check the return value of llistxattr. If llistxattr returned 0, qemu aborts. Signed-off-by: Kusanagi Kouichi Signed-off-by: Venkateswararao Jujjuri --- 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);