]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/AbsPointer: Don't access key codes when length is wrong
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 13 Sep 2018 08:06:52 +0000 (16:06 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 17 Oct 2018 03:04:02 +0000 (11:04 +0800)
commit0dd6065520742f62678db9dd6728f22b2abd68e2
tree63840b20aacc842c444fe9408e85c6abb0437037
parent8bcbe587e794aaaa6506b647732316ce5ba40168
MdeModulePkg/AbsPointer: Don't access key codes when length is wrong

Per USB HID spec, the buffer holding key codes should at least 3-byte
long.
Today's code assumes that the key codes buffer length is longer than
3-byte and unconditionally accesses the key codes buffer.
It's incorrect.
The patch fixes the issue by returning Device Error when the
length is less than 3-byte.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c