summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2015-01-18 17:16:06 +0000
committermpi <mpi@openbsd.org>2015-01-18 17:16:06 +0000
commit4e4160e6db62cab6d3079af8e5b10a10fc367d4b (patch)
tree0f63e484bdad252afc2f12bdb59a6f1156587b0e
parentWhen restoring spsr values when handling traps use spsr_fsxc instead (diff)
downloadwireguard-openbsd-4e4160e6db62cab6d3079af8e5b10a10fc367d4b.tar.xz
wireguard-openbsd-4e4160e6db62cab6d3079af8e5b10a10fc367d4b.zip
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.
-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