From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nufot-0007Up-8b for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:41:27 -0400 Received: from [140.186.70.92] (port=47315 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nufos-0007Ub-0X for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:41:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nufoq-0000wt-KX for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:41:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27291) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nufoq-0000wn-D7 for qemu-devel@nongnu.org; Thu, 25 Mar 2010 01:41:24 -0400 Message-ID: <4BAAF58E.4050507@redhat.com> Date: Thu, 25 Mar 2010 01:33:02 -0400 From: john cooper MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 2/4] Add virtio disk identification support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: john.cooper@redhat.com, Rusty Russell , Marc Haber Fix bug which truncated serial string to 8 bytes, nul terminate. Signed-off-by: john cooper --- 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