diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-06-20 01:57:22 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-06-20 01:57:22 +0000 |
commit | bb0b761c6581604d71716e24bfdfed68b0093527 (patch) | |
tree | a656c040b229a24a2b7d358dbf8e978ebfd3f602 /LUFA/Drivers | |
parent | 6599238dab21b864a40ca1873f3621d9bbd10a4c (diff) | |
download | lufa-bb0b761c6581604d71716e24bfdfed68b0093527.tar.gz lufa-bb0b761c6581604d71716e24bfdfed68b0093527.tar.bz2 lufa-bb0b761c6581604d71716e24bfdfed68b0093527.zip |
Make the HID Report Parser Get/Set Report Item routines fail if a NULL pointer to a report item is given.
Minor visual enhancement to the HIDReportViewer project.
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r-- | LUFA/Drivers/USB/Class/Common/HIDParser.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.c b/LUFA/Drivers/USB/Class/Common/HIDParser.c index b90f89eb2..eb2f14c35 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -290,6 +290,9 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, bool USB_GetHIDReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem) { + if (ReportItem == NULL) + return false; + uint16_t DataBitsRem = ReportItem->Attributes.BitSize; uint16_t CurrentBit = ReportItem->BitOffset; uint32_t BitMask = (1 << 0); @@ -320,6 +323,9 @@ bool USB_GetHIDReportItemInfo(const uint8_t* ReportData, void USB_SetHIDReportItemInfo(uint8_t* ReportData, HID_ReportItem_t* const ReportItem) { + if (ReportItem == NULL) + return; + uint16_t DataBitsRem = ReportItem->Attributes.BitSize; uint16_t CurrentBit = ReportItem->BitOffset; uint32_t BitMask = (1 << 0); |