From c4571f04794154d405a69b79babfd74bcf9fc63a Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Fri, 28 Mar 2014 02:50:47 +0000 Subject: Add check to avoid null pointer deference. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Eric Dong git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15410 6f19259b-4bc3-4df7-8a09-765794883524 --- IntelFrameworkModulePkg/Universal/BdsDxe/Language.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'IntelFrameworkModulePkg/Universal') 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. // -- cgit v1.2.3