VirtualBox

Changeset 99558 in vbox


Ignore:
Timestamp:
Apr 28, 2023 1:54:03 PM (19 months ago)
Author:
vboxsync
Message:

DevPS2K/UsbKbd: Improved range checks.

Location:
trunk/src/VBox/Devices/Input
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/DevPS2K.cpp

    r98103 r99558  
    406406
    407407#define PS2K_PAGE_DC_START      0xb0
    408 #define PS2K_PAGE_DC_END        (PS2K_PAGE_DC_START + RT_ELEMENTS(aPS2DCKeys))
     408#define PS2K_PAGE_DC_END        (PS2K_PAGE_DC_START + RT_ELEMENTS(aPS2DCKeys) - 1)
    409409#define PS2K_PAGE_CC_START      0xc0
    410 #define PS2K_PAGE_CC_END        (PS2K_PAGE_CC_START + RT_ELEMENTS(aPS2CCKeys))
     410#define PS2K_PAGE_CC_END        (PS2K_PAGE_CC_START + RT_ELEMENTS(aPS2CCKeys) - 1)
    411411
    412412AssertCompile(RT_ELEMENTS(aPS2CCKeys) <= 0x20); /* Must fit between 0xC0-0xDF. */
  • trunk/src/VBox/Devices/Input/UsbKbd.cpp

    r98103 r99558  
    656656
    657657#define USBHID_PAGE_DC_START    0xb0
    658 #define USBHID_PAGE_DC_END      (USBHID_PAGE_DC_START + RT_ELEMENTS(aHidDCKeys))
     658#define USBHID_PAGE_DC_END      (USBHID_PAGE_DC_START + RT_ELEMENTS(aHidDCKeys) - 1)
    659659#define USBHID_PAGE_CC_START    0xc0
    660 #define USBHID_PAGE_CC_END      (USBHID_PAGE_CC_START + RT_ELEMENTS(aHidCCKeys))
     660#define USBHID_PAGE_CC_END      (USBHID_PAGE_CC_START + RT_ELEMENTS(aHidCCKeys) - 1)
    661661
    662662AssertCompile(RT_ELEMENTS(aHidCCKeys) <= 0x20); /* Must fit between 0xC0-0xDF. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette