[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio-9p: Check the return value of llistxattr
From: |
Venkateswararao Jujjuri (JV) |
Subject: |
Re: [Qemu-devel] [PATCH] virtio-9p: Check the return value of llistxattr. |
Date: |
Sat, 30 Oct 2010 14:29:44 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 |
On 10/29/2010 7:52 PM, Kusanagi Kouichi wrote:
> If llistxattr returned 0, qemu aborts.
>
> Signed-off-by: Kusanagi Kouichi <address@hidden>
Acked-by: Venkateswararao Jujjuri <address@hidden>
> ---
> 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);