From: Kusanagi Kouichi <slash@ac.auone-net.jp>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] virtio-9p: Check the return value of llistxattr.
Date: Sat, 30 Oct 2010 11:52:39 +0900 [thread overview]
Message-ID: <20101030025240.0676A6FC03B@msa105.auone-net.jp> (raw)
If llistxattr returned 0, qemu aborts.
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
---
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
next reply other threads:[~2010-10-30 2:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-30 2:52 Kusanagi Kouichi [this message]
2010-10-30 21:29 ` [Qemu-devel] [PATCH] virtio-9p: Check the return value of llistxattr Venkateswararao Jujjuri (JV)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101030025240.0676A6FC03B@msa105.auone-net.jp \
--to=slash@ac.auone-net.jp \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).