From patchwork Wed Mar 20 10:16:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 229309 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C0EAA2C008D for ; Wed, 20 Mar 2013 21:17:49 +1100 (EST) Received: from localhost ([::1]:34479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIG5b-0006Hy-Nz for incoming@patchwork.ozlabs.org; Wed, 20 Mar 2013 06:17:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIG5L-0006Gu-Sa for qemu-devel@nongnu.org; Wed, 20 Mar 2013 06:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIG5J-0002mc-It for qemu-devel@nongnu.org; Wed, 20 Mar 2013 06:17:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIG5J-0002mJ-BN for qemu-devel@nongnu.org; Wed, 20 Mar 2013 06:17:29 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2KAHSpN011002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Mar 2013 06:17:28 -0400 Received: from dhcp-8-167.nay.redhat.com ([10.66.4.143]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2KAHP1B023667; Wed, 20 Mar 2013 06:17:26 -0400 From: Amos Kong To: aliguori@us.ibm.com, qemu-devel@nongnu.org Date: Wed, 20 Mar 2013 18:16:34 +0800 Message-Id: <1363774594-21001-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kraxel@redhat.com Subject: [Qemu-devel] [PATCH] append the terminating '\0' to bootorder string X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Problem was introduced in commit c8a6ae8b. The last terminating '\0' was lost, use the right length 5 ("HALT\0"). Reported-by: Gerd Hoffmann Signed-off-by: Amos Kong Acked-by: Gerd Hoffmann --- vl.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vl.c b/vl.c index aeed7f4..d3172ea 100644 --- a/vl.c +++ b/vl.c @@ -1273,9 +1273,9 @@ char *get_boot_devices_list(size_t *size) if (boot_strict && *size > 0) { list[total-1] = '\n'; - list = g_realloc(list, total + 4); - memcpy(&list[total], "HALT", 4); - *size = total + 4; + list = g_realloc(list, total + 5); + memcpy(&list[total], "HALT", 5); + *size = total + 5; } return list; }