From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C92A1A1E60 for ; Mon, 10 Oct 2016 19:15:57 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 10 Oct 2016 19:15:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,327,1473145200"; d="scan'208";a="771124111" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 10 Oct 2016 19:15:57 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 10 Oct 2016 19:15:56 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 10 Oct 2016 19:15:56 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.101]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.234]) with mapi id 14.03.0248.002; Tue, 11 Oct 2016 10:15:54 +0800 From: "Ni, Ruiyu" To: "Dong, Eric" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] Nt32Pkg WinNtSimpleFileSystemDxe: Correct file length. Thread-Index: AQHSItFsocbZULq7fkeGsLzG6HwmzaCihR8Q Date: Tue, 11 Oct 2016 02:15:54 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E17C6E@SHSMSX104.ccr.corp.intel.com> References: <1476088578-77204-1-git-send-email-eric.dong@intel.com> In-Reply-To: <1476088578-77204-1-git-send-email-eric.dong@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] Nt32Pkg WinNtSimpleFileSystemDxe: Correct file length. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 02:15:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni > -----Original Message----- > From: Dong, Eric > Sent: Monday, October 10, 2016 4:36 PM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu > Subject: [Patch] Nt32Pkg WinNtSimpleFileSystemDxe: Correct file length. >=20 > In GetInfo interface, current code copy real file name buffer with full p= ath > file length. It should use real file name length. This patch fix this err= or. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Eric Dong > Cc: Ruiyu Ni > --- > .../WinNtSimpleFileSystem.c | 28 +++++++++++-----= ------ > 1 file changed, 14 insertions(+), 14 deletions(-) >=20 > diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > index feef184..6cff2df 100644 > --- a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > +++ b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > @@ -1,6 +1,6 @@ > /**@file >=20 > -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> 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 > @@ -1987,8 +1987,19 @@ Returns: > CHAR16 *TempPointer; >=20 > Size =3D SIZE_OF_EFI_FILE_INFO; > - NameSize =3D StrSize (PrivateFile->FileName); > - ResultSize =3D Size + NameSize; > + > + RealFileName =3D PrivateFile->FileName; > + TempPointer =3D RealFileName; > + while (*TempPointer) { > + if (*TempPointer =3D=3D '\\') { > + RealFileName =3D TempPointer + 1; > + } > + > + TempPointer++; > + } > + NameSize =3D StrSize (RealFileName); > + > + ResultSize =3D Size + NameSize; >=20 > Status =3D EFI_BUFFER_TOO_SMALL; > if (*BufferSize >=3D ResultSize) { > @@ -2056,17 +2067,6 @@ Returns: > Info->Attribute |=3D EFI_FILE_DIRECTORY; > } >=20 > - RealFileName =3D PrivateFile->FileName; > - TempPointer =3D RealFileName; > - > - while (*TempPointer) { > - if (*TempPointer =3D=3D '\\') { > - RealFileName =3D TempPointer + 1; > - } > - > - TempPointer++; > - } > - > if (PrivateFile->IsRootDirectory) { > *((CHAR8 *) Buffer + Size) =3D 0; > } else { > -- > 2.6.4.windows.1