mirror of https://github.com/AxioDL/boo.git
Fix crash in HIDListenerIOKit when wLenDone == 0
This commit is contained in:
parent
44e8317d49
commit
1d02741879
|
@ -43,6 +43,9 @@ static bool getUSBStringDescriptor(IOUSBDeviceInterface182** usbDevice, UInt8 id
|
||||||
// we're mallocing this string just as an example. But you probably will want
|
// we're mallocing this string just as an example. But you probably will want
|
||||||
// to do something smarter, like pre-allocated buffers in the info class, or
|
// to do something smarter, like pre-allocated buffers in the info class, or
|
||||||
// use a string class.
|
// use a string class.
|
||||||
|
if (request.wLenDone == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
unsigned count = (request.wLenDone - 1) / 2;
|
unsigned count = (request.wLenDone - 1) / 2;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i=0 ; i<count ; ++i)
|
for (i=0 ; i<count ; ++i)
|
||||||
|
|
Loading…
Reference in New Issue