From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52756 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PC1Yr-0007aO-Fr for qemu-devel@nongnu.org; Fri, 29 Oct 2010 22:52:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PC1Yq-0002Cb-8Z for qemu-devel@nongnu.org; Fri, 29 Oct 2010 22:52:53 -0400 Received: from msa105.auone-net.jp ([61.117.18.165]:37126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PC1Yq-0002Bz-0S for qemu-devel@nongnu.org; Fri, 29 Oct 2010 22:52:52 -0400 Received: from ppp.dion.ne.jp (ZJ081080.ppp.dion.ne.jp [222.4.81.80]) by msa105.auone-net.jp (au one net msa) with ESMTP id 0676A6FC03B for ; Sat, 30 Oct 2010 11:52:39 +0900 (JST) Date: Sat, 30 Oct 2010 11:52:39 +0900 From: Kusanagi Kouichi MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Message-Id: <20101030025240.0676A6FC03B@msa105.auone-net.jp> Subject: [Qemu-devel] [PATCH] virtio-9p: Check the return value of llistxattr. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org If llistxattr returned 0, qemu aborts. Signed-off-by: Kusanagi Kouichi --- hw/virtio-9p-xattr.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/virtio-9p-xattr.c b/hw/virtio-9p-xattr.c index 175f372..1aab081 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); -- 1.7.2.3