From 6454d0bc96525d692817b52f382feb52dcde6f77 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Wed, 19 May 2021 17:41:54 +0200 Subject: [PATCH] bmp_libusb: Invalidate manufacturer and product in case libusb_get_string_descriptor_ascii fails. Prevent more false detections --- src/platforms/hosted/bmp_libusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platforms/hosted/bmp_libusb.c b/src/platforms/hosted/bmp_libusb.c index 63aad38..8739710 100644 --- a/src/platforms/hosted/bmp_libusb.c +++ b/src/platforms/hosted/bmp_libusb.c @@ -201,9 +201,11 @@ int find_debuggers(BMP_CL_OPTIONS_t *cl_opts,bmp_info_t *info) } if (res < 0) serial[0] = 0; + manufacturer[0] = 0; res = libusb_get_string_descriptor_ascii( handle, desc.iManufacturer, (uint8_t*)manufacturer, sizeof(manufacturer)); + product[0] = 0; res = libusb_get_string_descriptor_ascii( handle, desc.iProduct, (uint8_t*)product, sizeof(product));