summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-09-05 12:22:24 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-09-05 12:22:24 +0000
commit9e6cdc2afad789a9cd6eb913d111447802c6b227 (patch)
tree7474a19d80d2bd3728bfd89e0054467d43c66e30 /sys/dev/usb
parent5f08ffea716b3834e7cb211011673a1602c3f05f (diff)
Correct a bounds test. Coverity CID 1452930.
ok mpi@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/udl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c
index ab381fad777..0d179825f2b 100644
--- a/sys/dev/usb/udl.c
+++ b/sys/dev/usb/udl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udl.c,v 1.87 2017/04/08 02:57:25 deraadt Exp $ */
+/* $OpenBSD: udl.c,v 1.88 2017/09/05 12:22:23 jsg Exp $ */
/*
* Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org>
@@ -1312,7 +1312,7 @@ udl_select_chip(struct udl_softc *sc)
s = &serialnum[0];
n = len / 2 - 1;
- for (i = 0; i < n && i < USB_MAX_STRING_LEN; i++) {
+ for (i = 0; i < n && i < nitems(us.bString); i++) {
c = UGETW(us.bString[i]);
/* Convert from Unicode, handle buggy strings. */
if ((c & 0xff00) == 0)