mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
9946c0a93e
commit
e74c427978
|
@ -2850,8 +2850,17 @@ EfiConfigKeywordHandlerSetData (
|
||||||
Status = ExtractNameSpace (StringPtr, &NameSpace, &NextStringPtr);
|
Status = ExtractNameSpace (StringPtr, &NameSpace, &NextStringPtr);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
*ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
|
*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;
|
StringPtr = NextStringPtr;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -3124,6 +3133,13 @@ EfiConfigKeywordHandlerGetData (
|
||||||
*ProgressErr = KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND;
|
*ProgressErr = KEYWORD_HANDLER_NAMESPACE_ID_NOT_FOUND;
|
||||||
return Status;
|
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) {
|
if (KeywordString != NULL) {
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue