summaryrefslogtreecommitdiffstats
path: root/lib/libusbhid/usage.c
diff options
context:
space:
mode:
authorpat <pat@openbsd.org>2006-03-30 06:39:36 +0000
committerpat <pat@openbsd.org>2006-03-30 06:39:36 +0000
commitcbbaf2e7b5fb3f10d5afab506cb01fc02afd3a74 (patch)
tree6fef95ce15299c2084f0e5fc27fd6a063d5277a9 /lib/libusbhid/usage.c
parentintroduce a way to free the base. (diff)
downloadwireguard-openbsd-cbbaf2e7b5fb3f10d5afab506cb01fc02afd3a74.tar.xz
wireguard-openbsd-cbbaf2e7b5fb3f10d5afab506cb01fc02afd3a74.zip
Fix a bzero() misuse; ok otto@ deraadt@
Diffstat (limited to 'lib/libusbhid/usage.c')
-rw-r--r--lib/libusbhid/usage.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libusbhid/usage.c b/lib/libusbhid/usage.c
index bcfa0d8d1ea..164e9e6a93b 100644
--- a/lib/libusbhid/usage.c
+++ b/lib/libusbhid/usage.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usage.c,v 1.9 2006/03/21 21:38:55 jaredy Exp $ */
+/* $OpenBSD: usage.c,v 1.10 2006/03/30 06:39:36 pat Exp $ */
/* $NetBSD: usage.c,v 1.1 2001/12/28 17:45:27 augustss Exp $ */
/*
@@ -159,7 +159,8 @@ hid_start(const char *hidname)
}
pages = new;
bzero(pages + npagesmax,
- npagesmax - npagesmax);
+ (len - npagesmax) *
+ sizeof(struct usage_page));
}
if (!pages) {
free(n);