SignedCapsulePkg IniParsingLib: ASSERT to ensure 'Value' is not NULL

Function GetStringFromDataFile() ensures its fourth (output) parameter
will not be NULL when the return status is EFI_SUCCESS.

This commit adds ASSERT as warnings for the case that will not happen.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Hao Wu 2016-11-16 15:47:55 +08:00
parent b4dc05e854
commit cf2ddcf133
1 changed files with 4 additions and 0 deletions

View File

@ -1257,6 +1257,7 @@ GetGuidFromDataFile (
if (EFI_ERROR(Status)) {
return EFI_NOT_FOUND;
}
ASSERT (Value != NULL);
if (!IsValidGuid(Value, AsciiStrLen(Value))) {
return EFI_NOT_FOUND;
}
@ -1303,6 +1304,7 @@ GetDecimalUintnFromDataFile (
if (EFI_ERROR(Status)) {
return EFI_NOT_FOUND;
}
ASSERT (Value != NULL);
if (!IsValidDecimalString(Value, AsciiStrLen(Value))) {
return EFI_NOT_FOUND;
}
@ -1346,6 +1348,7 @@ GetHexUintnFromDataFile (
if (EFI_ERROR(Status)) {
return EFI_NOT_FOUND;
}
ASSERT (Value != NULL);
if (!IsValidHexString(Value, AsciiStrLen(Value))) {
return EFI_NOT_FOUND;
}
@ -1389,6 +1392,7 @@ GetHexUint64FromDataFile (
if (EFI_ERROR(Status)) {
return EFI_NOT_FOUND;
}
ASSERT (Value != NULL);
if (!IsValidHexString(Value, AsciiStrLen(Value))) {
return EFI_NOT_FOUND;
}