diff options
author | Eric Dong <eric.dong@intel.com> | 2015-08-20 00:22:16 +0000 |
---|---|---|
committer | ydong10 <ydong10@Edk2> | 2015-08-20 00:22:16 +0000 |
commit | e74c427978b5fb92621ffbf44a11c703b18a1233 (patch) | |
tree | 3a45682b2ea1edac4ca7a074c0eb649738158799 | |
parent | 9946c0a93e54dbf503cac692169b28b35ddd81d3 (diff) | |
download | edk2-e74c427978b5fb92621ffbf44a11c703b18a1233.tar.gz edk2-e74c427978b5fb92621ffbf44a11c703b18a1233.tar.bz2 edk2-e74c427978b5fb92621ffbf44a11c703b18a1233.zip |
Validate the input namespace field to avoid assert.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18239 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index 4cf803c54f..eac7717053 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -2850,8 +2850,17 @@ EfiConfigKeywordHandlerSetData ( Status = ExtractNameSpace (StringPtr, &NameSpace, &NextStringPtr);
if (EFI_ERROR (Status)) {
*ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
- return Status;
+ goto Done;
}
+ //
+ // 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;
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
+ }
+
StringPtr = NextStringPtr;
//
@@ -3124,7 +3133,14 @@ EfiConfigKeywordHandlerGetData ( *ProgressErr = KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND;
return Status;
}
-
+ //
+ // 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 (KeywordString != NULL) {
//
// Use temp string to avoid changing input string buffer.
|