From: "Eric Milliken" <emilliken@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] fix heap overflow in block-vmdk.c
Date: Sun, 13 Jan 2008 14:38:54 -0500 [thread overview]
Message-ID: <f6979bd0801131138u47f53510q7d87b61f74086f0f@mail.gmail.com> (raw)
It's possible to set a parentFileNameHint argument > 1023 bytes in the
image file, causing an overflow at the strncpy.
diff -ru qemu-0.9.1/block-vmdk.c qemu-0.9.1-p/block-vmdk.c
--- qemu-0.9.1/block-vmdk.c 2008-01-06 14:38:42.000000000 -0500
+++ qemu-0.9.1-p/block-vmdk.c 2008-01-13 14:30:23.000000000 -0500
@@ -342,6 +342,9 @@
if ((end_name = strchr(p_name,'\"')) == 0)
return -1;
+ if ((end_name - p_name) > sizeof (s->hd->backing_file) - 1)
+ return -1;
+
strncpy(s->hd->backing_file, p_name, end_name - p_name);
if (stat(s->hd->backing_file, &file_buf) != 0) {
path_combine(parent_img_name, sizeof(parent_img_name),
reply other threads:[~2008-01-13 19:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=f6979bd0801131138u47f53510q7d87b61f74086f0f@mail.gmail.com \
--to=emilliken@gmail.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).