From 4eb5923d1aa09a0169f0aab8cfb458b839132f25 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 16 Jul 2011 08:29:12 +0000 Subject: - 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 --- lib/libusb/libusb20.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libusb/libusb20.c') diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c index 716f5403529d..b35e2bf46eb1 100644 --- a/lib/libusb/libusb20.c +++ b/lib/libusb/libusb20.c @@ -1081,6 +1081,8 @@ libusb20_dev_get_iface_desc(struct libusb20_device *pdev, if ((buf == NULL) || (len == 0)) return (LIBUSB20_ERROR_INVALID_PARAM); + buf[0] = 0; /* set default string value */ + return (pdev->beMethods->dev_get_iface_desc( pdev, iface_index, buf, len)); } -- cgit v1.2.3