Skip to content

Commit

Permalink
SetupDataPkg/ConfApp: Fix incorrect type used in a GUID print (#381)
Browse files Browse the repository at this point in the history
## Description

The DEBUG message will throughout expectations, due to pass wrong type
variable.
The %g parameter need to pass the GUID pointer not the variable itself.
so chang TargetGuids[i] to &TargetGuids[i]

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

Test have been run on an Arm based simulator. No exception throughout
after adding the &.

## Integration Instructions

N/A
  • Loading branch information
congmomo committed Jul 16, 2024
1 parent c781a93 commit fb0659d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SetupDataPkg/ConfApp/SetupConf.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,20 +732,20 @@ CreateXmlStringFromCurrentSettings (
DataSize = 0;
Status = mPolicyProtocol->GetPolicy (&TargetGuids[i], NULL, Data, (UINT16 *)&DataSize);
if (Status != EFI_BUFFER_TOO_SMALL) {
DEBUG ((DEBUG_ERROR, "%a Failed to get configuration policy size %g - %r\n", __FUNCTION__, TargetGuids[i], Status));
DEBUG ((DEBUG_ERROR, "%a Failed to get configuration policy size %g - %r\n", __FUNCTION__, &TargetGuids[i], Status));
ASSERT (FALSE);
continue;
}

Data = AllocatePool (DataSize);
if (Data == NULL) {
DEBUG ((DEBUG_ERROR, "%a Unable to allocate pool for configuration policy %g\n", __FUNCTION__, TargetGuids[i]));
DEBUG ((DEBUG_ERROR, "%a Unable to allocate pool for configuration policy %g\n", __FUNCTION__, &TargetGuids[i]));
break;
}

Status = mPolicyProtocol->GetPolicy (&TargetGuids[i], NULL, Data, (UINT16 *)&DataSize);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a Failed to get configuration policy %g - %r\n", __FUNCTION__, TargetGuids[i], Status));
DEBUG ((DEBUG_ERROR, "%a Failed to get configuration policy %g - %r\n", __FUNCTION__, &TargetGuids[i], Status));
ASSERT (FALSE);
FreePool (Data);
Data = NULL;
Expand Down

0 comments on commit fb0659d

Please sign in to comment.