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/Application/Shell/ShellParametersProtocol.c

    r99404 r108794  
    355355  if (Status == EFI_BUFFER_TOO_SMALL) {
    356356    FullCommandLine = AllocateZeroPool (Size + LoadedImage->LoadOptionsSize);
    357     Status          = SHELL_GET_ENVIRONMENT_VARIABLE (L"ShellOpt", &Size, FullCommandLine);
     357    if (FullCommandLine == NULL) {
     358      return EFI_OUT_OF_RESOURCES;
     359    }
     360
     361    Status = SHELL_GET_ENVIRONMENT_VARIABLE (L"ShellOpt", &Size, FullCommandLine);
    358362  }
    359363
     
    739743  CommandLineCopy  = NULL;
    740744  FirstLocation    = NULL;
     745  TempHandle       = NULL;
    741746
    742747  if ((ShellParameters == NULL) || (SystemTableInfo == NULL) || (OldStdIn == NULL) || (OldStdOut == NULL) || (OldStdErr == NULL)) {
     
    11771182        if (!ErrUnicode && !EFI_ERROR (Status)) {
    11781183          TempHandle = CreateFileInterfaceFile (TempHandle, FALSE);
    1179           ASSERT (TempHandle != NULL);
     1184          if (TempHandle == NULL) {
     1185            ASSERT (TempHandle != NULL);
     1186            Status = EFI_OUT_OF_RESOURCES;
     1187          }
    11801188        }
    11811189
     
    12241232          if (!OutUnicode && !EFI_ERROR (Status)) {
    12251233            TempHandle = CreateFileInterfaceFile (TempHandle, FALSE);
    1226             ASSERT (TempHandle != NULL);
     1234            if (TempHandle == NULL) {
     1235              ASSERT (TempHandle != NULL);
     1236              Status = EFI_OUT_OF_RESOURCES;
     1237            }
    12271238          }
    12281239
     
    12461257
    12471258        TempHandle = CreateFileInterfaceEnv (StdOutVarName);
    1248         ASSERT (TempHandle != NULL);
    1249         ShellParameters->StdOut = TempHandle;
    1250         gST->ConOut             = CreateSimpleTextOutOnFile (TempHandle, &gST->ConsoleOutHandle, gST->ConOut);
     1259        if (TempHandle == NULL) {
     1260          ASSERT (TempHandle != NULL);
     1261          Status = EFI_OUT_OF_RESOURCES;
     1262        } else {
     1263          ShellParameters->StdOut = TempHandle;
     1264          gST->ConOut             = CreateSimpleTextOutOnFile (TempHandle, &gST->ConsoleOutHandle, gST->ConOut);
     1265        }
    12511266      }
    12521267
     
    12631278
    12641279        TempHandle = CreateFileInterfaceEnv (StdErrVarName);
    1265         ASSERT (TempHandle != NULL);
    1266         ShellParameters->StdErr = TempHandle;
    1267         gST->StdErr             = CreateSimpleTextOutOnFile (TempHandle, &gST->StandardErrorHandle, gST->StdErr);
     1280        if (TempHandle == NULL) {
     1281          ASSERT (TempHandle != NULL);
     1282          Status = EFI_OUT_OF_RESOURCES;
     1283        } else {
     1284          ShellParameters->StdErr = TempHandle;
     1285          gST->StdErr             = CreateSimpleTextOutOnFile (TempHandle, &gST->StandardErrorHandle, gST->StdErr);
     1286        }
    12681287      }
    12691288
     
    13081327          }
    13091328
    1310           ShellParameters->StdIn = TempHandle;
    1311           gST->ConIn             = CreateSimpleTextInOnFile (TempHandle, &gST->ConsoleInHandle);
     1329          if (TempHandle == NULL) {
     1330            Status = EFI_OUT_OF_RESOURCES;
     1331          } else {
     1332            ShellParameters->StdIn = TempHandle;
     1333            gST->ConIn             = CreateSimpleTextInOnFile (TempHandle, &gST->ConsoleInHandle);
     1334          }
    13121335        }
    13131336      }
     
    14481471  }
    14491472
    1450   if (OldArgc != NULL) {
     1473  if (OldArgv != NULL) {
    14511474    *OldArgv = ShellParameters->Argv;
    14521475  }
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