From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 2B115202E5356 for ; Mon, 25 Jun 2018 17:51:18 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 17:51:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,272,1526367600"; d="scan'208";a="240583405" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 25 Jun 2018 17:51:12 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Jun 2018 17:51:12 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Jun 2018 17:51:11 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.87]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.70]) with mapi id 14.03.0319.002; Tue, 26 Jun 2018 08:51:10 +0800 From: "Wu, Hao A" To: Thomas Palmer , "edk2-devel@lists.01.org" CC: "garyli@hpe.com" , "joseph.shifflett@hpe.com" , "Ni, Ruiyu" Thread-Topic: [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size Thread-Index: AQHUDLCIUDI7YqZkAUWDqaUiEp3KBaRxtbuw Date: Tue, 26 Jun 2018 00:51:09 +0000 Message-ID: References: <1529950518-16132-1-git-send-email-thomas.palmer@hpe.com> In-Reply-To: <1529950518-16132-1-git-send-email-thomas.palmer@hpe.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Tue, 26 Jun 2018 00:51:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: Thomas Palmer [mailto:thomas.palmer@hpe.com] > Sent: Tuesday, June 26, 2018 2:15 AM > To: edk2-devel@lists.01.org > Cc: garyli@hpe.com; joseph.shifflett@hpe.com; Ni, Ruiyu; Wu, Hao A; Thoma= s > Palmer > Subject: [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation siz= e >=20 > A single byte was allocate for a CHAR16 NUL terminator when instead > two bytes should have been used. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Thomas Palmer > --- > Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > 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 >=20 > 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 BS= D > License > which accompanies this distribution. The full text of the license may b= e found > at > @@ -453,7 +454,7 @@ Returns: > ASSERT (PcdTempStr !=3D NULL); >=20 > TempStrSize =3D StrLen (PcdTempStr); > - TempStr =3D AllocateMemory ((TempStrSize * sizeof (CHAR16)) + 1); > + TempStr =3D AllocateMemory (((TempStrSize + 1) * sizeof (CHAR16))); > StrCpy (TempStr, PcdTempStr); >=20 > StartString =3D TempStr; > -- > 2.7.4