From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: "Dong, Eric" <eric.dong@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] Nt32Pkg WinNtSimpleFileSystemDxe: Correct file length.
Date: Tue, 11 Oct 2016 02:15:54 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E17C6E@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1476088578-77204-1-git-send-email-eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
> -----Original Message-----
> From: Dong, Eric
> Sent: Monday, October 10, 2016 4:36 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>
> Subject: [Patch] Nt32Pkg WinNtSimpleFileSystemDxe: Correct file length.
>
> In GetInfo interface, current code copy real file name buffer with full path
> file length. It should use real file name length. This patch fix this error.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Eric Dong <eric.dong@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> ---
> .../WinNtSimpleFileSystem.c | 28 +++++++++++-----------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> 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
>
> -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> 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;
>
> Size = SIZE_OF_EFI_FILE_INFO;
> - NameSize = StrSize (PrivateFile->FileName);
> - ResultSize = Size + NameSize;
> +
> + RealFileName = PrivateFile->FileName;
> + TempPointer = RealFileName;
> + while (*TempPointer) {
> + if (*TempPointer == '\\') {
> + RealFileName = TempPointer + 1;
> + }
> +
> + TempPointer++;
> + }
> + NameSize = StrSize (RealFileName);
> +
> + ResultSize = Size + NameSize;
>
> Status = EFI_BUFFER_TOO_SMALL;
> if (*BufferSize >= ResultSize) {
> @@ -2056,17 +2067,6 @@ Returns:
> Info->Attribute |= EFI_FILE_DIRECTORY;
> }
>
> - RealFileName = PrivateFile->FileName;
> - TempPointer = RealFileName;
> -
> - while (*TempPointer) {
> - if (*TempPointer == '\\') {
> - RealFileName = TempPointer + 1;
> - }
> -
> - TempPointer++;
> - }
> -
> if (PrivateFile->IsRootDirectory) {
> *((CHAR8 *) Buffer + Size) = 0;
> } else {
> --
> 2.6.4.windows.1
prev parent reply other threads:[~2016-10-11 2:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-10 8:36 [Patch] Nt32Pkg WinNtSimpleFileSystemDxe: Correct file length Eric Dong
2016-10-11 2:15 ` Ni, Ruiyu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=734D49CCEBEEF84792F5B80ED585239D58E17C6E@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox