laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/27583 )
Change subject: intf_line.c: Make e1d_find_intf_by_usb_serial safe for empty string ......................................................................
intf_line.c: Make e1d_find_intf_by_usb_serial safe for empty string
Avoid segfault in case the empty string is passed as serial_str.
Change-Id: Ia69912cb714441415d8decd68890d1b97b77132d --- M src/intf_line.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/83/27583/1
diff --git a/src/intf_line.c b/src/intf_line.c index 0ff3942..c9011a8 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -100,6 +100,9 @@ { struct e1_intf *intf;
+ if (!serial_str) + return NULL; + llist_for_each_entry(intf, &e1d->interfaces, list) if (intf->usb.serial_str && !strcmp(intf->usb.serial_str, serial_str)) return intf;