mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-07 19:45:07 +02:00
MdeModulePkg/UdfDxe: ASSERT() valid ReadFileInfo Flags for INLINE_DATA req
In the ReadFile() function, if "RecordingFlags" is INLINE_DATA, then we cover the following values of "ReadFileInfo->Flags": - READ_FILE_GET_FILESIZE - READ_FILE_ALLOCATE_AND_READ - READ_FILE_SEEK_AND_READ We don't do anything (just proceed to the end of the function) if "ReadFileInfo->Flags" is anything else. In reality the above three values cover the domain of the UDF_READ_FILE_FLAGS enum type fully, and "ReadFileInfo->Flags" is only ever set internally to UdfDxe. Therefore any other flag value would be a bug in UdfDxe. ASSERT() specifically that "ReadFileInfo->Flags" has been set correctly, so that the reader is not left wondering what happens if none of the enum constants match. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Cc: Paulo Alcantara <pcacjr@zytor.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
parent
c05cae55eb
commit
a3240c63ec
@ -962,6 +962,9 @@ ReadFile (
|
||||
);
|
||||
|
||||
ReadFileInfo->FilePosition += ReadFileInfo->FileDataSize;
|
||||
} else {
|
||||
ASSERT (FALSE);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user