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 019C8211F8862 for ; Tue, 26 Jun 2018 18:04:08 -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; 26 Jun 2018 18:04:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,276,1526367600"; d="scan'208";a="240937597" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 26 Jun 2018 18:04:08 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 26 Jun 2018 18:04:08 -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; Wed, 27 Jun 2018 09:04:06 +0800 From: "Wu, Hao A" To: Thomas Palmer , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" Thread-Topic: [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size Thread-Index: AQHUDLCIUDI7YqZkAUWDqaUiEp3KBaRxtbuwgAGWJ5A= Date: Wed, 27 Jun 2018 01:04:06 +0000 Message-ID: References: <1529950518-16132-1-git-send-email-thomas.palmer@hpe.com> In-Reply-To: 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: Wed, 27 Jun 2018 01:04:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks a lot. Pushed as commit: d1fbfd7cd39af04d80ee9dab1455cccdf84aa316 Best Regards, Hao Wu > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Wu= , > Hao A > Sent: Tuesday, June 26, 2018 8:51 AM > To: Thomas Palmer; edk2-devel@lists.01.org > Cc: Ni, Ruiyu > Subject: Re: [edk2] [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory > allocation size >=20 > Reviewed-by: Hao Wu >=20 > Best Regards, > Hao Wu >=20 >=20 > > -----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; Tho= mas > > Palmer > > Subject: [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation > size > > > > 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 !=3D NULL); > > > > TempStrSize =3D StrLen (PcdTempStr); > > - TempStr =3D AllocateMemory ((TempStrSize * sizeof (CHAR16)) + 1); > > + TempStr =3D AllocateMemory (((TempStrSize + 1) * sizeof (CHAR16)))= ; > > StrCpy (TempStr, PcdTempStr); > > > > StartString =3D TempStr; > > -- > > 2.7.4 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel