mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
DynamicTablesPkg: Clear output parameter before callback invocation
BuildSmbiosTable() and BuildSmbiosTableEx() callback are called with uninitialized pointers which might contain garbage data. If one of these function fails, the exit handler uses these uninitialized fields. Set these uninitialized pointers in the caller function. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
This commit is contained in:
parent
e3e93cf092
commit
d1806ae8fa
1 changed files with 12 additions and 10 deletions
|
|
@ -207,16 +207,18 @@ BuildAndInstallMultipleSmbiosTables (
|
|||
UINTN TableCount;
|
||||
UINTN Index;
|
||||
|
||||
TableCount = 0;
|
||||
Status = Generator->BuildSmbiosTableEx (
|
||||
Generator,
|
||||
TableFactoryProtocol,
|
||||
SmbiosTableInfo,
|
||||
CfgMgrProtocol,
|
||||
&SmbiosTable,
|
||||
&CmObjToken,
|
||||
&TableCount
|
||||
);
|
||||
SmbiosTable = NULL;
|
||||
CmObjToken = NULL;
|
||||
TableCount = 0;
|
||||
Status = Generator->BuildSmbiosTableEx (
|
||||
Generator,
|
||||
TableFactoryProtocol,
|
||||
SmbiosTableInfo,
|
||||
CfgMgrProtocol,
|
||||
&SmbiosTable,
|
||||
&CmObjToken,
|
||||
&TableCount
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue