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(
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/34641
to look at the new patch set (#2).
Change subject: usbdev: do not accept serial numbers which starting the same as expected one, but shorter ......................................................................
usbdev: do not accept serial numbers which starting the same as expected one, but shorter
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/2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34641 )
Change subject: usbdev: do not accept serial numbers which starting the same as expected one, but shorter ......................................................................
Patch Set 2: Code-Review-1
See code comment above the changed line. The current behavior is intended. The code could always be extended, though, e.g. we could issue a warning or bail ot if multiple devices match the serial prefix?
Miklós Márton has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34641 )
Change subject: usbdev: do not accept serial numbers which starting the same as expected one, but shorter ......................................................................
Patch Set 2:
Patch Set 2: Code-Review-1
See code comment above the changed line. The current behavior is intended. The code could always be extended, though, e.g. we could issue a warning or bail ot if multiple devices match the serial prefix?
Ah, next time I will read not just code. I discovered this behaviour while tested the STLink V3 and found it strange.
Which solution would you prefer?
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/34641 )
Change subject: usbdev: do not accept serial numbers which starting the same as expected one, but shorter ......................................................................
Patch Set 2:
See code comment above the changed line. The current behavior is intended. The code could always be extended, though, e.g. we could issue a warning or bail ot if multiple devices match the serial prefix?
Ah, next time I will read not just code. I discovered this behaviour while tested the STLink V3 and found it strange.
Which solution would you prefer?
Bailing out if there are multiple matches, I guess. Though, that's probably hardest to implement.
Miklós Márton has abandoned this change. ( https://review.coreboot.org/c/flashrom/+/34641 )
Change subject: usbdev: do not accept serial numbers which starting the same as expected one, but shorter ......................................................................
Abandoned