VirtualBox

Ignore:
Timestamp:
Mar 31, 2025 11:31:09 AM (2 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168237
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

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/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c

    r105670 r108794  
    300300    SHELL_FREE_NON_NULL (Temp);
    301301    SHELL_FREE_NON_NULL (FileName);
     302    if (RetVal == NULL) {
     303      return NULL;
     304    }
    302305  }
    303306
     
    310313  DataType    = ConvertMemoryType (LoadedImage->ImageDataType);
    311314  CodeType    = ConvertMemoryType (LoadedImage->ImageCodeType);
    312 
    313   RetVal = CatSPrint (
    314              RetVal,
    315              Temp,
    316              LoadedImage->Revision,
    317              LoadedImage->ParentHandle,
    318              LoadedImage->SystemTable,
    319              LoadedImage->DeviceHandle,
    320              FilePath,
    321              PdbFileName,
    322              LoadedImage->LoadOptionsSize,
    323              LoadedImage->LoadOptions,
    324              LoadedImage->ImageBase,
    325              LoadedImage->ImageSize,
    326              CodeType,
    327              DataType,
    328              LoadedImage->Unload
    329              );
     315  if ((PdbFileName != NULL) && (DataType != NULL) && (CodeType != NULL) && (FilePath != NULL)) {
     316    RetVal = CatSPrint (
     317               RetVal,
     318               Temp,
     319               LoadedImage->Revision,
     320               LoadedImage->ParentHandle,
     321               LoadedImage->SystemTable,
     322               LoadedImage->DeviceHandle,
     323               FilePath,
     324               PdbFileName,
     325               LoadedImage->LoadOptionsSize,
     326               LoadedImage->LoadOptions,
     327               LoadedImage->ImageBase,
     328               LoadedImage->ImageSize,
     329               CodeType,
     330               DataType,
     331               LoadedImage->Unload
     332               );
     333  }
    330334
    331335  SHELL_FREE_NON_NULL (Temp);
     
    390394
    391395  Fmt = ConvertPixelFormat (GraphicsOutput->Mode->Info->PixelFormat);
     396  if (Fmt == NULL) {
     397    SHELL_FREE_NON_NULL (Temp);
     398    return NULL;
     399  }
    392400
    393401  RetVal = CatSPrint (
     
    410418
    411419  SHELL_FREE_NON_NULL (Temp);
     420  if (RetVal == NULL) {
     421    goto EXIT;
     422  }
    412423
    413424  Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_GOP_RES_LIST_MAIN), NULL);
     
    510521  RetVal = CatSPrint (NULL, Temp, EdidDiscovered->SizeOfEdid);
    511522  SHELL_FREE_NON_NULL (Temp);
     523  if (RetVal == NULL) {
     524    return NULL;
     525  }
    512526
    513527  if (EdidDiscovered->SizeOfEdid != 0) {
     
    576590  RetVal = CatSPrint (NULL, Temp, EdidActive->SizeOfEdid);
    577591  SHELL_FREE_NON_NULL (Temp);
     592  if (RetVal == NULL) {
     593    return NULL;
     594  }
    578595
    579596  if (EdidActive->SizeOfEdid != 0) {
     
    791808  Size   = (Dev->Mode->MaxMode + 1) * 80;
    792809  RetVal = AllocateZeroPool (Size);
     810  if (RetVal == NULL) {
     811    return NULL;
     812  }
    793813
    794814  Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_TXT_OUT_DUMP_HEADER), NULL);
     
    802822  //
    803823  Temp = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN (STR_TXT_OUT_DUMP_LINE), NULL);
     824  if (Temp == NULL) {
     825    FreePool (RetVal);
     826    return NULL;
     827  }
     828
    804829  for (Index = 0; Index < Dev->Mode->MaxMode; Index++) {
    805830    Status  = Dev->QueryMode (Dev, Index, &Col, &Row);
     
    10571082                       ConvertDevicePathToText (LoadedImage->FilePath, TRUE, TRUE)
    10581083                       );
     1084        if (TempRetVal == NULL) {
     1085          break;
     1086        }
     1087
    10591088        StrnCatGrow (&RetVal, &Size, TempRetVal, 0);
    10601089        SHELL_FREE_NON_NULL (TempRetVal);
     
    12881317             Pci.Hdr.ClassCode[2]
    12891318             );
     1319  if (RetVal == NULL) {
     1320    FreePool (GetString);
     1321    return NULL;
     1322  }
     1323
    12901324  for (Index = 0; Index < sizeof (Pci); Index++) {
    12911325    if ((Index % 0x10) == 0) {
     
    14361470
    14371471    RetVal = CatSPrint (NULL, TempStr);
     1472    if (RetVal == NULL) {
     1473      goto ERROR_EXIT;
     1474    }
     1475
    14381476    SHELL_FREE_NON_NULL (TempStr);
    14391477
     
    17271765
    17281766    RetVal = CatSPrint (NULL, TempStr, ImageInfoSize);
     1767    if (RetVal == NULL) {
     1768      goto ERROR_EXIT;
     1769    }
     1770
    17291771    SHELL_FREE_NON_NULL (TempStr);
    17301772
     
    18241866        AttributeSettingStr = CatSPrint (NULL, L"(");
    18251867
     1868        if (AttributeSettingStr == NULL) {
     1869          goto ERROR_EXIT;
     1870        }
     1871
    18261872        if ((AttributeSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) != 0x0) {
    18271873          TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_IMAGE_UPDATABLE");
     1874          if (TempRetVal == NULL) {
     1875            goto ERROR_EXIT;
     1876          }
     1877
    18281878          SHELL_FREE_NON_NULL (AttributeSettingStr);
    18291879          AttributeSettingStr = TempRetVal;
     
    18321882        if ((AttributeSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) != 0x0) {
    18331883          TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_RESET_REQUIRED");
     1884          if (TempRetVal == NULL) {
     1885            goto ERROR_EXIT;
     1886          }
     1887
    18341888          SHELL_FREE_NON_NULL (AttributeSettingStr);
    18351889          AttributeSettingStr = TempRetVal;
     
    18381892        if ((AttributeSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) != 0x0) {
    18391893          TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED");
     1894          if (TempRetVal == NULL) {
     1895            goto ERROR_EXIT;
     1896          }
     1897
    18401898          SHELL_FREE_NON_NULL (AttributeSettingStr);
    18411899          AttributeSettingStr = TempRetVal;
     
    18441902        if ((AttributeSetting & IMAGE_ATTRIBUTE_IN_USE) != 0x0) {
    18451903          TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_IN_USE");
     1904          if (TempRetVal == NULL) {
     1905            goto ERROR_EXIT;
     1906          }
     1907
    18461908          SHELL_FREE_NON_NULL (AttributeSettingStr);
    18471909          AttributeSettingStr = TempRetVal;
     
    18501912        if ((AttributeSetting & IMAGE_ATTRIBUTE_UEFI_IMAGE) != 0x0) {
    18511913          TempRetVal = CatSPrint (AttributeSettingStr, L" IMAGE_ATTRIBUTE_UEFI_IMAGE");
     1914          if (TempRetVal == NULL) {
     1915            goto ERROR_EXIT;
     1916          }
     1917
    18521918          SHELL_FREE_NON_NULL (AttributeSettingStr);
    18531919          AttributeSettingStr = TempRetVal;
     
    18551921
    18561922        TempRetVal = CatSPrint (AttributeSettingStr, L" )");
     1923        if (TempRetVal == NULL) {
     1924          goto ERROR_EXIT;
     1925        }
     1926
    18571927        SHELL_FREE_NON_NULL (AttributeSettingStr);
    18581928        AttributeSettingStr = TempRetVal;
     
    28492919  if (!EFI_ERROR (Status)) {
    28502920    BestLang = GetBestLanguageForDriver (CompNameStruct->SupportedLanguages, Language, FALSE);
    2851     Status   = CompNameStruct->GetDriverName (CompNameStruct, BestLang, &RetVal);
     2921    if (BestLang == NULL) {
     2922      return (NULL);
     2923    }
     2924
     2925    Status = CompNameStruct->GetDriverName (CompNameStruct, BestLang, &RetVal);
    28522926    if (BestLang != NULL) {
    28532927      FreePool (BestLang);
     
    28702944  if (!EFI_ERROR (Status)) {
    28712945    BestLang = GetBestLanguageForDriver (CompNameStruct->SupportedLanguages, Language, FALSE);
    2872     Status   = CompNameStruct->GetDriverName (CompNameStruct, BestLang, &RetVal);
     2946    if (BestLang == NULL) {
     2947      return (NULL);
     2948    }
     2949
     2950    Status = CompNameStruct->GetDriverName (CompNameStruct, BestLang, &RetVal);
    28732951    if (BestLang != NULL) {
    28742952      FreePool (BestLang);
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