qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: john cooper <john.cooper@redhat.com>
To: qemu-devel@nongnu.org
Cc: john.cooper@redhat.com, Rusty Russell <rusty@rustcorp.com.au>,
	Marc Haber <mh+qemu-devel@zugschlus.de>
Subject: [Qemu-devel] [PATCH 2/4] Add virtio disk identification support
Date: Thu, 25 Mar 2010 01:33:02 -0400	[thread overview]
Message-ID: <4BAAF58E.4050507@redhat.com> (raw)

Fix bug which truncated serial string to 8 bytes, nul terminate.

Signed-off-by: john cooper <john.cooper@redhat.com>
---

diff --git a/vl.c b/vl.c
index d69250c..b74cbba 100644
--- a/vl.c
+++ b/vl.c
@@ -1162,7 +1162,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
     dinfo->on_write_error = on_write_error;
     dinfo->opts = opts;
     if (serial)
-        strncpy(dinfo->serial, serial, sizeof(serial));
+        strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1);
     QTAILQ_INSERT_TAIL(&drives, dinfo, next);
 
     switch(type) {

-- 
john.cooper@redhat.com

             reply	other threads:[~2010-03-25  5:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25  5:33 john cooper [this message]
2010-06-03 19:10 ` [Qemu-devel] Re: [PATCH 2/4] Add virtio disk identification support Anthony Liguori
2010-06-04  6:34   ` john cooper

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=4BAAF58E.4050507@redhat.com \
    --to=john.cooper@redhat.com \
    --cc=mh+qemu-devel@zugschlus.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rusty@rustcorp.com.au \
    /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).