From: Gleb Natapov <gleb@qumranet.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] qemu_strdup() doesn't copy alast character
Date: Mon, 25 Aug 2008 12:22:11 +0300 [thread overview]
Message-ID: <20080825092211.GG6192@minantech.com> (raw)
Because of off by one error.
Signed-off-by: Gleb Natapov <gleb@qumranet.com>
diff --git a/qemu-malloc.c b/qemu-malloc.c
index 8ad6168..3bffae1 100644
--- a/qemu-malloc.c
+++ b/qemu-malloc.c
@@ -60,6 +60,6 @@ char *qemu_strdup(const char *str)
ptr = qemu_malloc(len + 1);
if (!ptr)
return NULL;
- pstrcpy(ptr, len, str);
+ pstrcpy(ptr, len + 1, str);
return ptr;
}
--
Gleb.
next reply other threads:[~2008-08-25 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-25 9:22 Gleb Natapov [this message]
2008-08-25 20:05 ` [Qemu-devel] [PATCH] qemu_strdup() doesn't copy alast character Blue Swirl
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=20080825092211.GG6192@minantech.com \
--to=gleb@qumranet.com \
--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).