From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=15.233.44.27; helo=g2t2354.austin.hpe.com; envelope-from=thomas.palmer@hpe.com; receiver=edk2-devel@lists.01.org Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ED295211F888F for ; Mon, 25 Jun 2018 11:15:32 -0700 (PDT) Received: from arm-build-server.us.rdlabs.hpecorp.net (arm-build-server.us.rdlabs.hpecorp.net [16.84.24.54]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 6849891; Mon, 25 Jun 2018 18:15:31 +0000 (UTC) From: Thomas Palmer To: edk2-devel@lists.01.org Cc: garyli@hpe.com, joseph.shifflett@hpe.com, ruiyu.ni@intel.com, hao.a.wu@intel.com, Thomas Palmer Date: Mon, 25 Jun 2018 13:15:18 -0500 Message-Id: <1529950518-16132-1-git-send-email-thomas.palmer@hpe.com> X-Mailer: git-send-email 2.7.4 Subject: [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 18:15:33 -0000 A single byte was allocate for a CHAR16 NUL terminator when instead two bytes should have been used. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Palmer --- Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c index 1516ab8d1c12..cfce4a0af345 100644 --- a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c +++ b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c @@ -1,6 +1,7 @@ /**@file Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -453,7 +454,7 @@ Returns: ASSERT (PcdTempStr != NULL); TempStrSize = StrLen (PcdTempStr); - TempStr = AllocateMemory ((TempStrSize * sizeof (CHAR16)) + 1); + TempStr = AllocateMemory (((TempStrSize + 1) * sizeof (CHAR16))); StrCpy (TempStr, PcdTempStr); StartString = TempStr; -- 2.7.4