Changeset 6876 in vbox for trunk/src/VBox/Devices/PC/DevPcBios.cpp
- Timestamp:
- Feb 10, 2008 7:44:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r6873 r6876 844 844 do { \ 845 845 size_t _len = strlen(s) + 1; \ 846 if (pszStr + _len - (char *)pTable >= cbMax) \ 846 size_t _max = (unsigned)(pszStr + _len - (char *)pTable) + 1; \ 847 if (_max > cbMax) \ 847 848 return PDMDevHlpVMSetError(pDevIns, VERR_TOO_MUCH_DATA, RT_SRC_POS, \ 848 N_(" DMI string too long (%zu): \"%s\""), _len, s); \849 N_("One of the DMI strings is too long. Check all bios/Dmi* configuration entries. At least %zu bytes are needed but there is no space for more than %d bytes"), _max, cbMax); \ 849 850 memcpy(p, s, _len); \ 850 851 p += _len; \ … … 874 875 READCFG("DmiFamily", pszDmiFamily, "Virtual Machine"); 875 876 877 /* DMI BIOS information */ 876 878 PDMIBIOSINF pBIOSInf = (PDMIBIOSINF)pszStr; 877 879 pszStr = (char *)(pBIOSInf + 1); … … 904 906 *pszStr++ = '\0'; 905 907 906 908 /* DMI system information */ 907 909 PDMISYSTEMINF pSystemInf = (PDMISYSTEMINF)pszStr; 908 910 pszStr = (char *)(pSystemInf + 1); … … 940 942 *pszStr++ = '\0'; 941 943 944 /* If more fields are added here, fix the size check in STRCPY */ 945 942 946 #undef STRCPY 943 947 #undef READCFG 944 945 if (pszStr - (char *)pTable > VBOX_DMI_TABLE_SIZE)946 return PDMDevHlpVMSetError(pDevIns, VERR_BUFFER_OVERFLOW, RT_SRC_POS,947 N_("DMI table too long (have=%d, max=%d)"),948 pszStr - (char *)pTable, VBOX_DMI_TABLE_SIZE);949 948 950 949 MMR3HeapFree(pszDmiVendor); … … 1373 1372 uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid); 1374 1373 uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion); 1375 rc = pcbiosPlantDMITable(pDevIns, pData->au8DMIPage, 0x100 /* see below */, &uuid, pCfgHandle);1374 rc = pcbiosPlantDMITable(pDevIns, pData->au8DMIPage, VBOX_DMI_TABLE_SIZE, &uuid, pCfgHandle); 1376 1375 if (VBOX_FAILURE(rc)) 1377 1376 return rc; 1378 1377 if (pData->u8IOAPIC) 1379 pcbiosPlantMPStable(pDevIns, pData->au8DMIPage + 0x100);1378 pcbiosPlantMPStable(pDevIns, pData->au8DMIPage + VBOX_DMI_TABLE_SIZE); 1380 1379 1381 1380 rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, 0x1000, pData->au8DMIPage, false /* fShadow */, "DMI tables");
Note:
See TracChangeset
for help on using the changeset viewer.