mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
ShellPkg/EfiDecompress: Check presence of decompression protocol
Check the return value of LocateProtocol() before using the decompression protocol. This avoids a potential NULL pointer derefence spotted by codeql. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
This commit is contained in:
parent
d9185d45c2
commit
35a2f27546
1 changed files with 5 additions and 1 deletions
|
|
@ -120,7 +120,11 @@ MainCmdEfiDecompress (
|
|||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
Status = Decompress->GetInfo (Decompress, InBuffer, (UINT32)InSize, &OutSize, &ScratchSize);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue