aboutsummaryrefslogtreecommitdiff
path: root/LUFA
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-06-20 01:57:22 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-06-20 01:57:22 +0000
commitd10298c1518f416884d8b3252827ef15a7381b15 (patch)
treea656c040b229a24a2b7d358dbf8e978ebfd3f602 /LUFA
parent1b8e060bd0105d23cb2d91b6907e4aead3f12a71 (diff)
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. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1814 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Drivers/USB/Class/Common/HIDParser.c6
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 b90f89eb..eb2f14c3 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);