Changeset 108794 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.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/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
r105670 r108794 1765 1765 UINT64 Value; 1766 1766 CHAR8 **CharArray; 1767 UINTN StrLength; 1767 1768 1768 1769 if ((RedfishPlatformConfigPrivate == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (ConfigureLang) || (StatementValue == NULL)) { … … 1772 1773 TempBuffer = NULL; 1773 1774 StringArray = NULL; 1775 StrLength = 0; 1774 1776 1775 1777 Status = ProcessPendingList (&RedfishPlatformConfigPrivate->FormsetList, &RedfishPlatformConfigPrivate->PendingList); … … 1841 1843 StatementValue->BufferLen = TargetStatement->HiiStatement->StorageWidth; 1842 1844 StatementValue->BufferValueType = TargetStatement->HiiStatement->Value.BufferValueType; 1843 } else if ((TargetStatement->HiiStatement->Operand == EFI_IFR_NUMERIC_OP) && (StatementValue->Type == EFI_IFR_TYPE_NUM_SIZE_64)) { 1845 } else if (TargetStatement->HiiStatement->Operand == EFI_IFR_NUMERIC_OP) { 1846 if (StatementValue->Type == EFI_IFR_TYPE_NUM_SIZE_64) { 1847 // 1848 // Redfish only has numeric value type and it does not care about the value size. 1849 // Do a patch here so we have proper value size applied. 1850 // 1851 StatementValue->Type = TargetStatement->HiiStatement->Value.Type; 1852 } 1853 1844 1854 // 1845 // Redfish only has numeric value type and it does not care about the value size. 1846 // Do a patch here so we have proper value size applied. 1855 // Check maximum and minimum values when they are set. 1847 1856 // 1848 StatementValue->Type = TargetStatement->HiiStatement->Value.Type; 1857 if ((TargetStatement->StatementData.NumMaximum > 0) && (TargetStatement->StatementData.NumMaximum >= TargetStatement->StatementData.NumMinimum)) { 1858 if (StatementValue->Value.u64 > TargetStatement->StatementData.NumMaximum) { 1859 DEBUG ((DEBUG_ERROR, "%a: integer value: %lu is greater than maximum value: %lu\n", __func__, StatementValue->Value.u64, TargetStatement->StatementData.NumMaximum)); 1860 return EFI_ACCESS_DENIED; 1861 } else if (StatementValue->Value.u64 < TargetStatement->StatementData.NumMinimum) { 1862 DEBUG ((DEBUG_ERROR, "%a: integer value: %lu is smaller than minimum value: %lu\n", __func__, StatementValue->Value.u64, TargetStatement->StatementData.NumMinimum)); 1863 return EFI_ACCESS_DENIED; 1864 } 1865 } 1849 1866 } else { 1850 1867 DEBUG ((DEBUG_ERROR, "%a: catch value type mismatch! input type: 0x%x but target value type: 0x%x\n", __func__, StatementValue->Type, TargetStatement->HiiStatement->Value.Type)); … … 1854 1871 1855 1872 if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) && (StatementValue->Type == EFI_IFR_TYPE_STRING)) { 1873 // 1874 // Check string length when length limitation is set. 1875 // 1876 if ((TargetStatement->StatementData.StrMaxSize > 0) && (TargetStatement->StatementData.StrMaxSize >= TargetStatement->StatementData.StrMinSize)) { 1877 StrLength = StrLen ((EFI_STRING)StatementValue->Buffer); 1878 if (StrLength > TargetStatement->StatementData.StrMaxSize) { 1879 DEBUG ((DEBUG_ERROR, "%a: string length: %u is greater than maximum string length: %u\n", __func__, StrLength, TargetStatement->StatementData.StrMaxSize)); 1880 return EFI_ACCESS_DENIED; 1881 } else if (StrLength < TargetStatement->StatementData.StrMinSize) { 1882 DEBUG ((DEBUG_ERROR, "%a: string length: %u is smaller than minimum string length: %u\n", __func__, StrLength, TargetStatement->StatementData.StrMinSize)); 1883 return EFI_ACCESS_DENIED; 1884 } 1885 } 1886 1856 1887 // 1857 1888 // Create string ID for new string. … … 2484 2515 ); 2485 2516 if (EFI_ERROR (Status)) { 2486 DEBUG ((DEBUG_ ERROR, "%a: locate EFI_HII_STRING_PROTOCOL failure: %r\n", __func__, Status));2517 DEBUG ((DEBUG_INFO, "%a: locate EFI_HII_STRING_PROTOCOL failure: %r\n", __func__, Status)); 2487 2518 return; 2488 2519 } … … 2519 2550 ); 2520 2551 if (EFI_ERROR (Status)) { 2521 DEBUG ((DEBUG_ ERROR, "%a: locate EFI_HII_DATABASE_PROTOCOL failure: %r\n", __func__, Status));2552 DEBUG ((DEBUG_INFO, "%a: locate EFI_HII_DATABASE_PROTOCOL failure: %r\n", __func__, Status)); 2522 2553 return; 2523 2554 } … … 2582 2613 ); 2583 2614 if (EFI_ERROR (Status)) { 2584 DEBUG ((DEBUG_ ERROR, "%a: locate EFI_REGULAR_EXPRESSION_PROTOCOL failure: %r\n", __func__, Status));2615 DEBUG ((DEBUG_INFO, "%a: locate EFI_REGULAR_EXPRESSION_PROTOCOL failure: %r\n", __func__, Status)); 2585 2616 return; 2586 2617 }
Note:
See TracChangeset
for help on using the changeset viewer.