summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/HiiDatabaseDxe
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-20 01:52:02 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-20 01:52:02 +0000
commit96ff65a1fb627823efaf4dc7cd01a424fa5297e8 (patch)
tree32254272c819993e9e12235ac421e06148cc7825 /MdeModulePkg/Universal/HiiDatabaseDxe
parent5a829f56880a176dc9a90e9d3653c961f9350aa0 (diff)
downloadedk2-96ff65a1fb627823efaf4dc7cd01a424fa5297e8.tar.gz
edk2-96ff65a1fb627823efaf4dc7cd01a424fa5297e8.tar.bz2
edk2-96ff65a1fb627823efaf4dc7cd01a424fa5297e8.zip
K8:
1) Fix the bug the assert conditions. || should be &&. 2) Add in code path and check-for-null-pointer to do error handling. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7308 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/Database.c2
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/Font.c6
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/String.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index 3d70207952..b1a3374991 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -2556,7 +2556,7 @@ ExportPackageList (
UINTN ResultSize;
EFI_HII_PACKAGE_HEADER EndofPackageList;
- ASSERT (Private != NULL || PackageList != NULL || UsedSize != NULL);
+ ASSERT (Private != NULL && PackageList != NULL && UsedSize != NULL);
ASSERT (Private->Signature == HII_DATABASE_PRIVATE_DATA_SIGNATURE);
ASSERT (IsHiiHandleValid (Handle));
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
index 06b09e7f76..82f47163b7 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
@@ -1566,6 +1566,7 @@ HiiStringToImage (
Status = EFI_SUCCESS;
StringIn2 = NULL;
SystemDefault = NULL;
+ StringIn = NULL;
//
// Calculate the string output information, including specified color and font .
@@ -1596,11 +1597,13 @@ HiiStringToImage (
Foreground = ((EFI_FONT_DISPLAY_INFO *) StringInfo)->ForegroundColor;
Background = ((EFI_FONT_DISPLAY_INFO *) StringInfo)->BackgroundColor;
- } else {
+ } else if (Status == EFI_SUCCESS) {
FontInfo = &StringInfoOut->FontInfo;
Height = StringInfoOut->FontInfo.FontSize;
Foreground = StringInfoOut->ForegroundColor;
Background = StringInfoOut->BackgroundColor;
+ } else {
+ goto Exit;
}
}
@@ -1609,7 +1612,6 @@ HiiStringToImage (
//
StringPtr = String;
- StringIn = NULL;
//
// Ignore line-break characters only. Hyphens or dash character will be displayed
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
index 8c207f9476..64148fe131 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
@@ -124,7 +124,7 @@ ConvertToUnicodeText (
ASSERT (StringSrc != NULL && BufferSize != NULL);
StringSize = AsciiStrSize (StringSrc) * 2;
- if (*BufferSize < StringSize) {
+ if (*BufferSize < StringSize || StringDest == NULL) {
*BufferSize = StringSize;
return EFI_BUFFER_TOO_SMALL;
}