summaryrefslogtreecommitdiff
path: root/lib/libusbhid
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-01-18 17:16:07 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-01-18 17:16:07 +0000
commit35d6f66a0155b7d16907a19d97a1a8185bfb6aed (patch)
tree7f23b5fa70c78bd2fd33f55ac48e4fe00ac4df34 /lib/libusbhid
parentbf72daf8f50bce3f472e6340ab1ab037497f0f07 (diff)
Do not calculated the length of a report with an extra byte for the
reportID because the kernel skips it. Problem reported and fix tested by Benjamin Baier.
Diffstat (limited to 'lib/libusbhid')
-rw-r--r--lib/libusbhid/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libusbhid/parse.c b/lib/libusbhid/parse.c
index a0d3baa0814..06624eccd77 100644
--- a/lib/libusbhid/parse.c
+++ b/lib/libusbhid/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.9 2014/05/12 17:03:28 mpi Exp $ */
+/* $OpenBSD: parse.c,v 1.10 2015/01/18 17:16:06 mpi Exp $ */
/* $NetBSD: parse.c,v 1.2 2001/12/29 20:44:22 augustss Exp $ */
/*
@@ -541,8 +541,8 @@ hid_report_size(report_desc_t r, enum hid_kind k, int id)
else
temp = hpos - lpos;
- /* return length in bytes rounded up */
- return ((temp + 7) / 8 + report_id);
+ /* No extra byte for the reportID because the kernel skips it. */
+ return ((temp + 7) / 8);
}
int