Skip to content

Commit

Permalink
Redfish/HiiUtilityLib Fix incorrect type assignment
Browse files Browse the repository at this point in the history
Replaced direct assignment of 'Value = (EFI_HII_VALUE *)&Question->Value'
with the correct usage of HiiStatementValueToHiiValue function.
This resolves the issue where EFI_HII_VALUE and HII_STATEMENT_VALUE types
are incompatible, ensuring proper handling of Question->Value.

Signed-off-by: Igor Kulchytskyy <[email protected]>
  • Loading branch information
igorkulchytskyy authored and mergify[bot] committed Dec 27, 2024
1 parent 9e65374 commit 0986082
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions RedfishPkg/Library/HiiUtilityLib/HiiUtilityInternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4125,7 +4125,12 @@ EvaluateHiiExpression (
goto Done;
}

Value = (EFI_HII_VALUE *)&Question->Value;
Status = HiiStatementValueToHiiValue (&Question->Value, Value);
if (EFI_ERROR (Status)) {
ReleaseHiiValue (Value);
Value->Type = EFI_IFR_TYPE_UNDEFINED;
}

break;

case EFI_IFR_SECURITY_OP:
Expand Down Expand Up @@ -4334,7 +4339,11 @@ EvaluateHiiExpression (
//
// push the questions' value on to the expression stack
//
Value = (EFI_HII_VALUE *)&Question->Value;
Status = HiiStatementValueToHiiValue (&Question->Value, Value);
if (EFI_ERROR (Status)) {
ReleaseHiiValue (Value);
Value->Type = EFI_IFR_TYPE_UNDEFINED;
}
}

break;
Expand Down Expand Up @@ -4461,7 +4470,12 @@ EvaluateHiiExpression (
break;
}

Value = (EFI_HII_VALUE *)&Question->Value;
Status = HiiStatementValueToHiiValue (&Question->Value, Value);
if (EFI_ERROR (Status)) {
ReleaseHiiValue (Value);
Value->Type = EFI_IFR_TYPE_UNDEFINED;
}

break;

case EFI_IFR_STRING_REF2_OP:
Expand Down

0 comments on commit 0986082

Please sign in to comment.