Fix Klockwork issue flagged in BootloaderCommonPkg (#646)
Fix for: Klockwork flags possible null pointer variable 'CompressHdr' being dereferenced. Signed-off-by: Vegnish Rao <vegnish.rao.paramesura.rao@intel.com> Co-authored-by: Vegnish Rao <vegnish.rao.paramesura.rao@intel.com>
This commit is contained in:
parent
e738eeafac
commit
de49b23c7e
|
@ -760,6 +760,10 @@ LoadComponentWithCallback (
|
|||
// Component must have LOADER_COMPRESSED_HEADER
|
||||
Status = EFI_UNSUPPORTED;
|
||||
CompressHdr = (LOADER_COMPRESSED_HEADER *)CompData;
|
||||
if (CompressHdr == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (IS_COMPRESSED (CompressHdr)) {
|
||||
SignedDataLen = sizeof (LOADER_COMPRESSED_HEADER) + CompressHdr->CompressedSize;
|
||||
if (SignedDataLen <= CompLen) {
|
||||
|
|
Loading…
Reference in New Issue