diff options
author | Eric Dong <eric.dong@intel.com> | 2014-06-26 03:24:25 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-06-26 03:24:25 +0000 |
commit | 523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0 (patch) | |
tree | 91d3cdacf538e40a24922981037cd413af4f6123 /MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | |
parent | d0f65b21c58b958ba370e774c6fe3ddc5ff1f3c7 (diff) | |
download | edk2-523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0.zip edk2-523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0.tar.gz edk2-523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0.tar.bz2 |
Refine code to make it more safely.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15598 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe/Font.c')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index 24bb502..eef31d5 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -2,7 +2,7 @@ Implementation for EFI_HII_FONT_PROTOCOL.
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1040,8 +1040,12 @@ IsSystemFontInfo ( return TRUE;
}
+ SystemDefault = NULL;
+ DefaultLen = 0;
+
Status = GetSystemFont (Private, &SystemDefault, &DefaultLen);
ASSERT_EFI_ERROR (Status);
+ ASSERT ((SystemDefault != NULL) && (DefaultLen != 0));
//
// Record the system default info.
@@ -1687,6 +1691,7 @@ HiiStringToImage ( SysFontFlag = IsSystemFontInfo (Private, (EFI_FONT_DISPLAY_INFO *) StringInfo, &SystemDefault, NULL);
if (SysFontFlag) {
+ ASSERT (SystemDefault != NULL);
FontInfo = NULL;
Height = SystemDefault->FontInfo.FontSize;
BaseLine = SystemDefault->FontInfo.FontSize;
@@ -2580,6 +2585,7 @@ HiiGetGlyph ( Foreground = StringInfoOut->ForegroundColor;
Background = StringInfoOut->BackgroundColor;
} else {
+ ASSERT (SystemDefault != NULL);
Foreground = SystemDefault->ForegroundColor;
Background = SystemDefault->BackgroundColor;
}
@@ -2723,6 +2729,7 @@ HiiGetFontInfo ( return EFI_INVALID_PARAMETER;
}
+ StringInfoOutLen = 0;
FontInfo = NULL;
SystemDefault = NULL;
LocalFontHandle = NULL;
|