The 'Sting' is returned by the function GetUnicodeStringTextAndSize. If it is NULL, function GetUnicodeStringTextAndSize will return EFI_OUT_OF_RESOURCES, and error handling codes will cover it. So the pointer 'Sting' can not be NULL when using it. So we can add the ASSERT codes.
Cc: Eric Dong <eric.d...@intel.com> Cc: Hao Wu <hao.a...@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan...@intel.com> --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index 03f8141..6682319 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -873,11 +873,11 @@ GetStringIdFromString ( // Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); if (EFI_ERROR (Status)) { goto Done; } - + ASSERT (String != NULL); if (StrCmp(KeywordValue, String) == 0) { *StringId = CurrentStringId; goto Done; } BlockSize += Offset + StringSize; @@ -893,11 +893,11 @@ GetStringIdFromString ( // Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); if (EFI_ERROR (Status)) { goto Done; } - + ASSERT (String != NULL); if (StrCmp(KeywordValue, String) == 0) { *StringId = CurrentStringId; goto Done; } BlockSize += Offset + StringSize; @@ -912,11 +912,11 @@ GetStringIdFromString ( for (Index = 0; Index < StringCount; Index++) { Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); if (EFI_ERROR (Status)) { goto Done; } - + ASSERT (String != NULL); BlockSize += StringSize; if (StrCmp(KeywordValue, String) == 0) { *StringId = CurrentStringId; goto Done; } @@ -937,11 +937,11 @@ GetStringIdFromString ( for (Index = 0; Index < StringCount; Index++) { Status = GetUnicodeStringTextAndSize (StringTextPtr, &StringSize, &String); if (EFI_ERROR (Status)) { goto Done; } - + ASSERT (String != NULL); BlockSize += StringSize; if (StrCmp(KeywordValue, String) == 0) { *StringId = CurrentStringId; goto Done; } -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel