diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-04-03 07:18:39 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-04-03 07:18:39 +0000 |
commit | de12ae821ca969dc99665a00ed95b91fa8215429 (patch) | |
tree | f2f1ea7768dfe4e4447186466f056eedecf2ca16 | |
parent | 2426f6669fa93be63e224ecba57433976571a37e (diff) | |
download | edk2-platforms-de12ae821ca969dc99665a00ed95b91fa8215429.tar.xz |
Get the language string before use it to avoid reuse freed buffer.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14241 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index da0e17b38d..432b22469e 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -399,10 +399,10 @@ InitializeFrontPage ( CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
- if (gFrontPagePrivate.LanguageToken == NULL) {
- //
- // Get Support language list from variable.
- //
+ //
+ // Get Support language list from variable.
+ //
+ if (mLanguageString == NULL){
mLanguageString = GetEfiGlobalVariable (L"PlatformLangCodes");
if (mLanguageString == NULL) {
mLanguageString = AllocateCopyPool (
@@ -411,7 +411,9 @@ InitializeFrontPage ( );
ASSERT (mLanguageString != NULL);
}
+ }
+ if (gFrontPagePrivate.LanguageToken == NULL) {
//
// Count the language list number.
//
@@ -1223,6 +1225,7 @@ PlatformBdsEnterFrontPage ( if (mLanguageString != NULL) {
FreePool (mLanguageString);
+ mLanguageString = NULL;
}
//
//Will leave browser, check any reset required change is applied? if yes, reset system
|