mirror of https://github.com/acidanthera/audk.git
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> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
parent
87c04781d5
commit
3643e8e70d
|
@ -1,6 +1,6 @@
|
||||||
/**@file
|
/**@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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -1987,8 +1987,19 @@ Returns:
|
||||||
CHAR16 *TempPointer;
|
CHAR16 *TempPointer;
|
||||||
|
|
||||||
Size = SIZE_OF_EFI_FILE_INFO;
|
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;
|
Status = EFI_BUFFER_TOO_SMALL;
|
||||||
if (*BufferSize >= ResultSize) {
|
if (*BufferSize >= ResultSize) {
|
||||||
|
@ -2056,17 +2067,6 @@ Returns:
|
||||||
Info->Attribute |= EFI_FILE_DIRECTORY;
|
Info->Attribute |= EFI_FILE_DIRECTORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
RealFileName = PrivateFile->FileName;
|
|
||||||
TempPointer = RealFileName;
|
|
||||||
|
|
||||||
while (*TempPointer) {
|
|
||||||
if (*TempPointer == '\\') {
|
|
||||||
RealFileName = TempPointer + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
TempPointer++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PrivateFile->IsRootDirectory) {
|
if (PrivateFile->IsRootDirectory) {
|
||||||
*((CHAR8 *) Buffer + Size) = 0;
|
*((CHAR8 *) Buffer + Size) = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue