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
This commit is contained in:
@ -2556,7 +2556,7 @@ ExportPackageList (
|
|||||||
UINTN ResultSize;
|
UINTN ResultSize;
|
||||||
EFI_HII_PACKAGE_HEADER EndofPackageList;
|
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 (Private->Signature == HII_DATABASE_PRIVATE_DATA_SIGNATURE);
|
||||||
ASSERT (IsHiiHandleValid (Handle));
|
ASSERT (IsHiiHandleValid (Handle));
|
||||||
|
|
||||||
|
@ -1566,6 +1566,7 @@ HiiStringToImage (
|
|||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
StringIn2 = NULL;
|
StringIn2 = NULL;
|
||||||
SystemDefault = NULL;
|
SystemDefault = NULL;
|
||||||
|
StringIn = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Calculate the string output information, including specified color and font .
|
// Calculate the string output information, including specified color and font .
|
||||||
@ -1596,11 +1597,13 @@ HiiStringToImage (
|
|||||||
Foreground = ((EFI_FONT_DISPLAY_INFO *) StringInfo)->ForegroundColor;
|
Foreground = ((EFI_FONT_DISPLAY_INFO *) StringInfo)->ForegroundColor;
|
||||||
Background = ((EFI_FONT_DISPLAY_INFO *) StringInfo)->BackgroundColor;
|
Background = ((EFI_FONT_DISPLAY_INFO *) StringInfo)->BackgroundColor;
|
||||||
|
|
||||||
} else {
|
} else if (Status == EFI_SUCCESS) {
|
||||||
FontInfo = &StringInfoOut->FontInfo;
|
FontInfo = &StringInfoOut->FontInfo;
|
||||||
Height = StringInfoOut->FontInfo.FontSize;
|
Height = StringInfoOut->FontInfo.FontSize;
|
||||||
Foreground = StringInfoOut->ForegroundColor;
|
Foreground = StringInfoOut->ForegroundColor;
|
||||||
Background = StringInfoOut->BackgroundColor;
|
Background = StringInfoOut->BackgroundColor;
|
||||||
|
} else {
|
||||||
|
goto Exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1609,7 +1612,6 @@ HiiStringToImage (
|
|||||||
//
|
//
|
||||||
|
|
||||||
StringPtr = String;
|
StringPtr = String;
|
||||||
StringIn = NULL;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Ignore line-break characters only. Hyphens or dash character will be displayed
|
// Ignore line-break characters only. Hyphens or dash character will be displayed
|
||||||
|
@ -124,7 +124,7 @@ ConvertToUnicodeText (
|
|||||||
ASSERT (StringSrc != NULL && BufferSize != NULL);
|
ASSERT (StringSrc != NULL && BufferSize != NULL);
|
||||||
|
|
||||||
StringSize = AsciiStrSize (StringSrc) * 2;
|
StringSize = AsciiStrSize (StringSrc) * 2;
|
||||||
if (*BufferSize < StringSize) {
|
if (*BufferSize < StringSize || StringDest == NULL) {
|
||||||
*BufferSize = StringSize;
|
*BufferSize = StringSize;
|
||||||
return EFI_BUFFER_TOO_SMALL;
|
return EFI_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user