Changeset 107457 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jan 7, 2025 10:54:10 AM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r106061 r107457 2329 2329 AssertRCReturn(rc, rc); 2330 2330 rc = PDMDevHlpIoPortMap(pDevIns, pThis->hIoPortGpe0En, acpiR3CalcPmPort(pThis, GPE0_OFFSET + GPE0_BLK_LEN / 2)); 2331 AssertRCReturn(rc, rc); 2331 2332 2332 2333 return VINF_SUCCESS; … … 3680 3681 { 3681 3682 /* The following checks should be in sync the AssertReleaseMsg's below. */ 3682 if ( *pcbCustBin > cbBufAvail 3683 || *pcbCustBin < sizeof(ACPITBLHEADER)) 3684 rc = VERR_TOO_MUCH_DATA; 3685 3686 /* 3687 * Allocate buffer for the custom table binary data. 3688 */ 3689 *ppu8CustBin = (uint8_t *)PDMDevHlpMMHeapAlloc(pDevIns, *pcbCustBin); 3690 if (*ppu8CustBin) 3683 if ( *pcbCustBin <= cbBufAvail 3684 && *pcbCustBin > sizeof(ACPITBLHEADER)) 3691 3685 { 3692 rc = RTFileRead(FileCUSTBin, *ppu8CustBin, *pcbCustBin, NULL); 3693 if (RT_FAILURE(rc)) 3686 /* 3687 * Allocate buffer for the custom table binary data. 3688 */ 3689 *ppu8CustBin = (uint8_t *)PDMDevHlpMMHeapAlloc(pDevIns, *pcbCustBin); 3690 if (*ppu8CustBin) 3694 3691 { 3695 AssertMsgFailed(("RTFileRead(,,%d,NULL) -> %Rrc\n", *pcbCustBin, rc)); 3696 PDMDevHlpMMHeapFree(pDevIns, *ppu8CustBin); 3697 *ppu8CustBin = NULL; 3692 rc = RTFileRead(FileCUSTBin, *ppu8CustBin, *pcbCustBin, NULL); 3693 if (RT_FAILURE(rc)) 3694 { 3695 AssertMsgFailed(("RTFileRead(,,%d,NULL) -> %Rrc\n", *pcbCustBin, rc)); 3696 PDMDevHlpMMHeapFree(pDevIns, *ppu8CustBin); 3697 *ppu8CustBin = NULL; 3698 } 3698 3699 } 3700 else 3701 rc = VERR_NO_MEMORY; 3699 3702 } 3700 3703 else 3701 { 3702 rc = VERR_NO_MEMORY; 3703 } 3704 rc = VERR_TOO_MUCH_DATA; 3705 3704 3706 RTFileClose(FileCUSTBin); 3705 3707 }
Note:
See TracChangeset
for help on using the changeset viewer.