Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/dev/usb Pull up following revision(s) (requested by r...
details: https://anonhg.NetBSD.org/src/rev/9736d047a624
branches: netbsd-7
changeset: 799807:9736d047a624
user: snj <snj%NetBSD.org@localhost>
date: Fri Feb 26 21:34:27 2016 +0000
description:
Pull up following revision(s) (requested by riastradh in ticket #1089):
sys/dev/usb/hid.c: revision 1.43
Convert unsigned char to wider type before left shift.
Avoids undefined behaviour if shifted quantity overflows int.
CID 980971
diffstat:
sys/dev/usb/hid.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 9f8cae382bb9 -r 9736d047a624 sys/dev/usb/hid.c
--- a/sys/dev/usb/hid.c Fri Feb 26 21:28:29 2016 +0000
+++ b/sys/dev/usb/hid.c Fri Feb 26 21:34:27 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hid.c,v 1.35.14.1 2015/02/09 09:43:09 martin Exp $ */
+/* $NetBSD: hid.c,v 1.35.14.2 2016/02/26 21:34:27 snj Exp $ */
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.35.14.1 2015/02/09 09:43:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.35.14.2 2016/02/26 21:34:27 snj Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -455,7 +455,7 @@
num = (hpos + hsize + 7) / 8 - off;
for (i = 0; i < num; i++)
- data |= buf[off + i] << (i * 8);
+ data |= (unsigned long)buf[off + i] << (i * 8);
data >>= hpos % 8;
data &= (1 << hsize) - 1;
Home |
Main Index |
Thread Index |
Old Index