From patchwork Thu Mar 25 05:33:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: john cooper X-Patchwork-Id: 48493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6BA1B7BEE for ; Thu, 25 Mar 2010 16:48:21 +1100 (EST) Received: from localhost ([127.0.0.1]:47038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NufvW-00006C-Pm for incoming@patchwork.ozlabs.org; Thu, 25 Mar 2010 01:48:18 -0400 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 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2P5fMac018635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Mar 2010 01:41:22 -0400 Received: from anvil.naka.net (pilototp-int.redhat.com [10.11.232.41]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2P5fDZY005506; Thu, 25 Mar 2010 01:41:16 -0400 Message-ID: <4BAAF58E.4050507@redhat.com> Date: Thu, 25 Mar 2010 01:33:02 -0400 From: john cooper User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: qemu-devel@nongnu.org X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: john.cooper@redhat.com, Rusty Russell , Marc Haber Subject: [Qemu-devel] [PATCH 2/4] Add virtio disk identification support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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) {