laforge submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved tnt: Looks good to me, but someone else must approve
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(-)

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;

1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.

To view, visit change 27583. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Ia69912cb714441415d8decd68890d1b97b77132d
Gerrit-Change-Number: 27583
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: tnt <tnt@246tNt.com>
Gerrit-MessageType: merged