summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2015-08-24 06:25:50 +0000
committerdandanbi <dandanbi@Edk2>2015-08-24 06:25:50 +0000
commit2295075793e53e4b158b1e2eddaac4e5b602e8a7 (patch)
tree78144b5cc90d1309cac8a0f6354e602634c05a35
parentc41887279813b4df39afafa1522648cdd448652e (diff)
downloadedk2-platforms-2295075793e53e4b158b1e2eddaac4e5b602e8a7.tar.xz
MdeModulePkg:Refine the code in HiiDatabaseDxe
Check the local variable 'NameSpace' before use it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18274 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
index eac7717053..e88a0c4597 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
@@ -2852,6 +2852,7 @@ EfiConfigKeywordHandlerSetData (
*ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
goto Done;
}
+ ASSERT (NameSpace != NULL);
//
// 1.1 Check whether the input namespace is valid.
//
@@ -3136,9 +3137,11 @@ EfiConfigKeywordHandlerGetData (
//
// 1.1 Check whether the input namespace is valid.
//
- if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen (UEFI_CONFIG_LANG)) != 0) {
- *ProgressErr = KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
- return EFI_INVALID_PARAMETER;
+ if (NameSpace != NULL){
+ if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen (UEFI_CONFIG_LANG)) != 0) {
+ *ProgressErr = KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
+ return EFI_INVALID_PARAMETER;
+ }
}
if (KeywordString != NULL) {