diff options
author | hselasky <hselasky@FreeBSD.org> | 2011-07-16 08:29:12 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2011-07-16 08:29:12 +0000 |
commit | cbcc560b1ef4e3268956232dcc43c9f45bbb9e42 (patch) | |
tree | d29e1041d5757acef0079a9d43dae3ebbc16d7ec /lib/libusb/libusb10.c | |
parent | b3e331350eb3f9280f1c520a93d51993df0a659a (diff) | |
download | FreeBSD-src-cbcc560b1ef4e3268956232dcc43c9f45bbb9e42.zip FreeBSD-src-cbcc560b1ef4e3268956232dcc43c9f45bbb9e42.tar.gz |
- Add two missing functions to the LibUSB v0.1 API.
- Clamp the string length to 255 bytes when getting
the interface description.
- Clamp data request length to 65535 bytes when doing
control requests.
MFC after: 3 days
Diffstat (limited to 'lib/libusb/libusb10.c')
-rw-r--r-- | lib/libusb/libusb10.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 737e610..3ecba58 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -719,6 +719,8 @@ libusb_get_driver(struct libusb20_device *pdev, int interface, return (LIBUSB_ERROR_INVALID_PARAM); if (namelen < 1) return (LIBUSB_ERROR_INVALID_PARAM); + if (namelen > 255) + namelen = 255; err = libusb20_dev_get_iface_desc( pdev, interface, name, namelen); |