Caught few access to address 0

This commit is contained in:
jief 2020-03-05 00:54:59 +03:00
parent 2a106ef602
commit c6a59f85f9
4 changed files with 7 additions and 5 deletions

View File

@ -112,6 +112,7 @@ VOID* FindAcpiRsdPtr()
// Search EBDA
//
Address = (*(UINT16 *)(UINTN)(EBDA_BASE_ADDRESS)) << 4;
if ( Address == 0 ) return 0; // Jief : if Address==0, the first access at *(UINT64 *)(Address + Index) is at address 0. It's supposed to crash.
for (Index = 0; Index < 0x400 ; Index += 16) {
if (*(UINT64 *)(Address + Index) == EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE) {
return (VOID *)Address;

View File

@ -3940,17 +3940,17 @@ GetThemeTagSettings (
GlobalConfig.SelectionColor = (UINTN)GetPropertyInteger (Dict2, GlobalConfig.SelectionColor);
Dict2 = GetProperty (Dict, "Small");
if ((Dict2->type == kTagTypeString) && Dict2->string) {
if ( Dict2 && (Dict2->type == kTagTypeString) && Dict2->string) {
GlobalConfig.SelectionSmallFileName = PoolPrint (L"%a", Dict2->string);
}
Dict2 = GetProperty (Dict, "Big");
if ((Dict2->type == kTagTypeString) && Dict2->string) {
if ( Dict2 && (Dict2->type == kTagTypeString) && Dict2->string) {
GlobalConfig.SelectionBigFileName = PoolPrint (L"%a", Dict2->string);
}
Dict2 = GetProperty (Dict, "Indicator");
if ((Dict2->type == kTagTypeString) && Dict2->string) {
if ( Dict2 && (Dict2->type == kTagTypeString) && Dict2->string) {
GlobalConfig.SelectionIndicatorName = PoolPrint (L"%a", Dict2->string);
}

View File

@ -40,9 +40,9 @@ bool all_tests()
DebugLog(2, "A test failed\n");
PauseForKey(L"press");
}else{
#ifdef JIEF_DEBUG
DebugLog(2, "All tests are ok\n");
// PauseForKey(L"press");
#ifdef JIEF_DEBUG
PauseForKey(L"press");
#endif
}
return all_ok;

View File

@ -2169,6 +2169,7 @@ VOID REFIT_MENU_SCREEN::HidePointer()
EFI_STATUS REFIT_MENU_SCREEN::MouseBirth()
{
if ( !mPointer ) return RETURN_INVALID_PARAMETER;
return mPointer->MouseBirth();
}