diff options
author | Kusanagi Kouichi <slash@ac.auone-net.jp> | 2010-10-30 11:52:39 +0900 |
---|---|---|
committer | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2010-12-02 16:08:27 -0800 |
commit | 0562c67432991d1cee442615d70fd39e638bec71 (patch) | |
tree | 8bf7c936c1e22af74b8b06f4e4bfbfc877ea7e43 /hw/virtio-9p-xattr.c | |
parent | d04e2826f5509092c8f0c6c3db7fa3232d912f7e (diff) |
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.c | 3 |
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); |