Correct incoming buffer size comparison to the incoming buffer, not the existing buffer.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11344 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2011-03-04 16:22:15 +00:00
parent 17a6c337d2
commit b80022da3b
1 changed files with 2 additions and 2 deletions

View File

@ -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));