Miklós Márton has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/34641 )
Change subject: usbdev: fix accepting shorter serial numbers than the real one. ......................................................................
usbdev: fix accepting shorter serial numbers than the real one.
Change-Id: Ife8c4e0a957c4345e27ec9ae9e1480ca80fe505c --- M usbdev.c 1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/41/34641/1
diff --git a/usbdev.c b/usbdev.c index 764ac04..7e41235 100644 --- a/usbdev.c +++ b/usbdev.c @@ -104,7 +104,8 @@ msg_pdbg("Serial number is %s\n", myserial);
/* Filter out any serial number that does not commence with serialno */ - return 0 != strncmp(serialno, (char *)myserial, strlen(serialno)); + return strlen((char *)myserial) == strlen(serialno) + && 0 != strncmp(serialno, (char *)myserial, strlen(serialno)); }
struct libusb_device_handle *usb_dev_get_by_vid_pid_serial(