mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 12:51:47 +00:00
Fixed potential NULL pointer dereference in the HID Host mode Class Driver (thanks to Pavel Kuzmin).
This commit is contained in:
parent
95fd3bf0fe
commit
fa2a8fca69
@ -46,6 +46,7 @@
|
|||||||
* - Fixed incorrect ordering of the linker options in the build system causing link failures in some cases
|
* - Fixed incorrect ordering of the linker options in the build system causing link failures in some cases
|
||||||
* - Fixed bug in the TWI peripheral driver for the AVR8 devices causing incorrect failure codes to be returned in some cases (thanks to Peter K)
|
* - Fixed bug in the TWI peripheral driver for the AVR8 devices causing incorrect failure codes to be returned in some cases (thanks to Peter K)
|
||||||
* - Fixed swapped LED3 and LED4 masks for the Olimex-32U4 development board LED driver
|
* - Fixed swapped LED3 and LED4 masks for the Olimex-32U4 development board LED driver
|
||||||
|
* - Fixed potential NULL pointer dereference in the HID Host mode Class Driver (thanks to Pavel Kuzmin)
|
||||||
* - Library Applications:
|
* - Library Applications:
|
||||||
* - Fixed broken RESET_TOGGLES_LIBUSB_COMPAT compile time option in the AVRISP-MKII project
|
* - Fixed broken RESET_TOGGLES_LIBUSB_COMPAT compile time option in the AVRISP-MKII project
|
||||||
* - Fixed incompatibility in the CDC class bootloader on some systems (thanks to Sylvain Munaut)
|
* - Fixed incompatibility in the CDC class bootloader on some systems (thanks to Sylvain Munaut)
|
||||||
|
@ -57,7 +57,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
|
|||||||
USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
|
||||||
DCOMP_HID_Host_NextHIDInterfaceEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
|
DCOMP_HID_Host_NextHIDInterfaceEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
|
||||||
{
|
{
|
||||||
if (DataINEndpoint || DataOUTEndpoint)
|
if (DataINEndpoint)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -97,16 +97,19 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
|
|||||||
HIDInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
|
HIDInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize);
|
||||||
HIDInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
|
HIDInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress;
|
||||||
HIDInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_INTERRUPT;
|
HIDInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_INTERRUPT;
|
||||||
|
|
||||||
HIDInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
|
|
||||||
HIDInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
|
|
||||||
HIDInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_INTERRUPT;
|
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (DataOUTEndpoint)
|
||||||
return false;
|
{
|
||||||
|
HIDInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
|
||||||
|
HIDInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress;
|
||||||
|
HIDInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_INTERRUPT;
|
||||||
|
|
||||||
|
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
|
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
|
||||||
HIDInterfaceInfo->State.HIDReportSize = LE16_TO_CPU(HIDDescriptor->HIDReportLength);
|
HIDInterfaceInfo->State.HIDReportSize = LE16_TO_CPU(HIDDescriptor->HIDReportLength);
|
||||||
|
Loading…
Reference in New Issue
Block a user