From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>
Subject: [PATCH 1/9] tests/virtio-9p: v9fs_string_read() didn't terminate string
Date: Mon, 16 Dec 2019 00:17:48 +0100 [thread overview]
Message-ID: <E1ihMue-00076W-9u@lizzy.crudebyte.com> (raw)
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
tests/virtio-9p-test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
index e7b58e3a0c..880b4ff567 100644
--- a/tests/virtio-9p-test.c
+++ b/tests/virtio-9p-test.c
@@ -130,8 +130,9 @@ static void v9fs_string_read(P9Req *req, uint16_t *len, char **string)
*len = local_len;
}
if (string) {
- *string = g_malloc(local_len);
+ *string = g_malloc(local_len+1);
v9fs_memread(req, *string, local_len);
+ (*string)[local_len] = 0;
} else {
v9fs_memskip(req, local_len);
}
--
2.20.1
next reply other threads:[~2019-12-18 0:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-15 23:17 Christian Schoenebeck [this message]
2019-12-18 8:47 ` [PATCH 1/9] tests/virtio-9p: v9fs_string_read() didn't terminate string Greg Kurz
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=E1ihMue-00076W-9u@lizzy.crudebyte.com \
--to=qemu_oss@crudebyte.com \
--cc=groug@kaod.org \
--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).