summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-06-24 13:19:14 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-07 15:02:20 +0800
commitcaa8a4fba576d8007561ebf60d825c831cf4c445 (patch)
treee9af749f2546b522fe93bbec5b09c01e9be80337
parent92fd5da3ddd3f29855ef54a9c6971eb2d58c7c8e (diff)
downloadedk2-platforms-caa8a4fba576d8007561ebf60d825c831cf4c445.tar.xz
MdeModulePkg/HiiDatabaseDxe: Add ASSERT before using the pointer 'String'
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.dong@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> (cherry picked from commit 763cfa739b1733715fe6700a29ec078c36453f5e)
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
index ce2216517c..d1306b3f38 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
@@ -875,7 +875,7 @@ GetStringIdFromString (
if (EFI_ERROR (Status)) {
goto Done;
}
-
+ ASSERT (String != NULL);
if (StrCmp(KeywordValue, String) == 0) {
*StringId = CurrentStringId;
goto Done;
@@ -895,7 +895,7 @@ GetStringIdFromString (
if (EFI_ERROR (Status)) {
goto Done;
}
-
+ ASSERT (String != NULL);
if (StrCmp(KeywordValue, String) == 0) {
*StringId = CurrentStringId;
goto Done;
@@ -914,7 +914,7 @@ GetStringIdFromString (
if (EFI_ERROR (Status)) {
goto Done;
}
-
+ ASSERT (String != NULL);
BlockSize += StringSize;
if (StrCmp(KeywordValue, String) == 0) {
*StringId = CurrentStringId;
@@ -939,7 +939,7 @@ GetStringIdFromString (
if (EFI_ERROR (Status)) {
goto Done;
}
-
+ ASSERT (String != NULL);
BlockSize += StringSize;
if (StrCmp(KeywordValue, String) == 0) {
*StringId = CurrentStringId;