dnp_citizen: Better sanitization of the iManufacturer string

This commit is contained in:
Solomon Peachy 2020-02-26 21:11:14 -05:00
parent d751e9b6d3
commit a37678f9f8
1 changed files with 2 additions and 2 deletions

View File

@ -887,10 +887,10 @@ static int dnpds40_attach(void *vctx, struct libusb_device_handle *dev, int type
udev = libusb_get_device(ctx->dev);
libusb_get_device_descriptor(udev, &desc);
char buf[256];
char buf[STR_LEN_MAX + 1];
buf[0] = 0;
buf[STR_LEN_MAX] = 0;
libusb_get_string_descriptor_ascii(ctx->dev, desc.iManufacturer, (unsigned char*)buf, STR_LEN_MAX);
// XXX sanitize_string(buf);
if (!strncmp(buf, "Dai", 3)) /* "Dai Nippon Printing" */
ctx->mfg = 0;