mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
SecurityPkg: Add sanity check for File and FileBuffer inputs
Ensure that either File or FileBuffer is provided before proceeding with security verification. If both are NULL, return EFI_INVALID_PARAMETER. This prevents verification from running without a valid input buffer and aligns with the intended design, where File is optional and FileBuffer alone is sufficient. Signed-off-by: Vignesh G <vigneshg@ami.com>
This commit is contained in:
parent
08258192d4
commit
56cad12011
1 changed files with 6 additions and 2 deletions
|
|
@ -1705,9 +1705,13 @@ DxeImageVerificationHandler (
|
|||
IsFoundInDatabase = FALSE;
|
||||
|
||||
//
|
||||
// Sanity check
|
||||
// Sanity check:
|
||||
// Ensure that either File or FileBuffer is provided.
|
||||
// Return EFI_INVALID_PARAMETER if both are NULL.
|
||||
// This prevents security verification from proceeding
|
||||
// when no valid input buffer is available.
|
||||
//
|
||||
if (File == NULL) {
|
||||
if ((File == NULL) && (FileBuffer == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue