bmp_libusb: Invalidate manufacturer and product in case libusb_get_string_descriptor_ascii fails.

Prevent more false detections
This commit is contained in:
Uwe Bonnes 2021-05-19 17:41:54 +02:00 committed by UweBonnes
parent df575eb090
commit 6454d0bc96
1 changed files with 2 additions and 0 deletions

View File

@ -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));