VirtualBox

Ignore:
Timestamp:
Mar 12, 2019 12:40:12 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129295
Message:

EFI: First step in UDK2018 merge. Does not build yet.

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/UefiLib/UefiLibPrint.c

    r58466 r77662  
    33  Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
    44
    5   Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
     5  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
    66  This program and the accompanying materials
    77  are licensed and made available under the terms and conditions of the BSD License
     
    475475    ASSERT (UgaDraw!= NULL);
    476476
    477     Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
     477    //
     478    // Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow.
     479    //
     480    if (Blt->Width > DivU64x32 (MAX_UINTN, Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL))) {
     481      goto Error;
     482    }
     483
     484    Blt->Image.Bitmap = AllocateZeroPool ((UINT32) Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
    478485    ASSERT (Blt->Image.Bitmap != NULL);
    479486
     
    755762  }
    756763
    757   BufferToReturn = AllocateZeroPool(SizeRequired);
     764  BufferToReturn = AllocatePool(SizeRequired);
    758765
    759766  if (BufferToReturn == NULL) {
    760767    return NULL;
     768  } else {
     769    BufferToReturn[0] = L'\0';
    761770  }
    762771
    763772  if (String != NULL) {
    764     StrCpy(BufferToReturn, String);
     773    StrCpyS(BufferToReturn, SizeRequired / sizeof(CHAR16), String);
    765774  }
    766775
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette