Changeset 108794 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c
- Timestamp:
- Mar 31, 2025 11:31:09 AM (2 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168237
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-164365 /vendor/edk2/current 103735-103757,103769-103776,129194-168232
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c
r101291 r108794 86 86 } else { 87 87 TempParam = ShellCommandLineGetRawValue (Package, 1); 88 ASSERT (TempParam != NULL); 88 if (TempParam == NULL) { 89 ASSERT (TempParam != NULL); 90 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"efidecompress"); 91 ShellStatus = SHELL_INVALID_PARAMETER; 92 goto Done; 93 } 94 89 95 InFileName = ShellFindFilePath (TempParam); 90 96 OutFileName = ShellCommandLineGetRawValue (Package, 2); 91 if ( InFileName == NULL) {97 if ((InFileName == NULL) || (OutFileName == NULL)) { 92 98 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam); 93 99 ShellStatus = SHELL_NOT_FOUND; … … 113 119 if (ShellStatus == SHELL_SUCCESS) { 114 120 Status = FileHandleGetSize (InFileHandle, &Temp64Bit); 115 ASSERT_EFI_ERROR (Status); 116 if (!EFI_ERROR (Status)) { 117 ASSERT (Temp64Bit <= (UINT32)(-1)); 118 InSize = (UINTN)Temp64Bit; 119 InBuffer = AllocateZeroPool (InSize); 120 } 121 121 if (EFI_ERROR (Status)) { 122 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"efidecompress", ShellCommandLineGetRawValue (Package, 1)); 123 ShellStatus = SHELL_NOT_FOUND; 124 } 125 } 126 127 if (ShellStatus == SHELL_SUCCESS) { 128 // 129 // Limit the File Size to UINT32, even though calls accept UINTN. 130 // 32 bits = 4gb. 131 // 132 Status = SafeUint64ToUint32 (Temp64Bit, (UINT32 *)&InSize); 133 if (EFI_ERROR (Status)) { 134 ASSERT_EFI_ERROR (Status); 135 ShellStatus = SHELL_BAD_BUFFER_SIZE; 136 goto Done; 137 } 138 139 InBuffer = AllocateZeroPool (InSize); 122 140 if (InBuffer == NULL) { 123 141 Status = EFI_OUT_OF_RESOURCES; … … 167 185 } 168 186 187 Done: 188 169 189 ShellCommandLineFreeVarList (Package); 170 190 }
Note:
See TracChangeset
for help on using the changeset viewer.