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
This commit is contained in:
Dandan Bi 2015-08-24 06:25:50 +00:00 committed by dandanbi
parent c418872798
commit 2295075793
1 changed files with 6 additions and 3 deletions

View File

@ -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) {