diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2014-03-28 02:50:47 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-03-28 02:50:47 +0000 |
commit | c4571f04794154d405a69b79babfd74bcf9fc63a (patch) | |
tree | 7a716badfc852cd6445389e38b3552d427330bd9 /IntelFrameworkModulePkg/Universal/BdsDxe | |
parent | 3a4b498ee1f10d2ed7ac4f29f99d69d1abb9f24b (diff) | |
download | edk2-platforms-c4571f04794154d405a69b79babfd74bcf9fc63a.tar.xz |
Add check to avoid null pointer deference.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15410 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/Language.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c index 4c74b018af..39455e44da 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Language.c @@ -408,19 +408,18 @@ InitializeLangVariable ( IN BOOLEAN Iso639Language
)
{
- EFI_STATUS Status;
CHAR8 *Lang;
//
// Find current Lang or PlatformLang from EFI Variable.
//
- Status = GetEfiGlobalVariable2 (LangName, (VOID **) &Lang, NULL);
+ GetEfiGlobalVariable2 (LangName, (VOID **) &Lang, NULL);
//
// If Lang or PlatformLang variable is not found,
// or it has been set to an unsupported value(not one of the supported language codes),
// set the default language code to it.
//
- if (EFI_ERROR (Status) || !IsLangInSupportedLangCodes (SupportedLang, Lang, Iso639Language)) {
+ if ((Lang == NULL) || !IsLangInSupportedLangCodes (SupportedLang, Lang, Iso639Language)) {
//
// The default language code should be one of the supported language codes.
//
|