X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Nt32Pkg%2FWinNtSimpleFileSystemDxe%2FWinNtSimpleFileSystem.c;h=ef9fa8673c5ceac7a30278e4537d7a6235d66b94;hb=b80022da3b54bda5de3da298a56a7ec0e5873384;hp=fd925b931244404156fd608a1dc9be52a1d86a5c;hpb=f515069c194f418b74915be4a2e021c2b3ae2c46;p=mirror_edk2.git diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c index fd925b9312..ef9fa8673c 100644 --- a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c +++ b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c @@ -2350,12 +2350,12 @@ Returns: // Set file system information. // if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) { - if (BufferSize < SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel)) { + NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer; + if (BufferSize < SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (NewFileSystemInfo->VolumeLabel)) { Status = EFI_BAD_BUFFER_SIZE; goto Done; } - NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer; FreePool (PrivateRoot->VolumeLabel); PrivateRoot->VolumeLabel = AllocatePool (StrSize (NewFileSystemInfo->VolumeLabel)); @@ -2631,8 +2631,8 @@ Returns: FreePool (TempFileName); } } else { + Status = EFI_ACCESS_DENIED; Reopen: ; - Status = EFI_DEVICE_ERROR; NtStatus = PrivateFile->WinNtThunk->SetFileAttributes (OldFileName, OldAttr); @@ -2829,6 +2829,7 @@ Reopen: ; NtStatus = PrivateFile->WinNtThunk->SetFileAttributes (NewFileName, NewAttr); if (!NtStatus) { + Status = EFI_DEVICE_ERROR; goto Reopen; }