ref: f3b451f2346be787705816530db1b590392324f2
parent: dfad6424529bf068837c1972bb1c17be7e7247bb
author: ppatience0 <ppatience0@gmail.com>
date: Fri Jul 5 14:42:15 EDT 2013
nusb: only read 18 bytes for device descriptor
--- a/sys/src/cmd/nusb/lib/dev.c
+++ b/sys/src/cmd/nusb/lib/dev.c
@@ -231,7 +231,7 @@
int
loaddevdesc(Dev *d)
{- uchar buf[Ddevlen+255];
+ uchar buf[Ddevlen];
int nr;
int type;
Ep *ep0;
@@ -238,7 +238,7 @@
type = Rd2h|Rstd|Rdev;
nr = sizeof(buf);
- memset(buf, 0, Ddevlen);
+ memset(buf, 0, nr);
if((nr=usbcmd(d, type, Rgetdesc, Ddev<<8|0, 0, buf, nr)) < 0)
return -1;
/*
--
⑨