Blame SOURCES/0016-tui-connect-crash-rh1456826.patch

fc9aca
From c710b2bf095e9301066d33a13e8a406f0d134b2f Mon Sep 17 00:00:00 2001
fc9aca
From: Arnaud Lefebvre <a.lefebvre@outlook.fr>
fc9aca
Date: Tue, 30 May 2017 13:45:32 +0200
fc9aca
Subject: [PATCH 1/1] nmtui connect: avoid segfault when iface is not found
fc9aca
fc9aca
https://github.com/NetworkManager/NetworkManager/pull/21
fc9aca
(cherry picked from commit 1fcbb69ae22ed4a6047e36c816f49b2a67a13583)
fc9aca
(cherry picked from commit cc36b9f6eb7870d02e0df7c26a7a980709b620fd)
fc9aca
---
fc9aca
 clients/tui/nmt-connect-connection-list.c | 10 +++++++---
fc9aca
 1 file changed, 7 insertions(+), 3 deletions(-)
fc9aca
fc9aca
diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c
fc9aca
index edfaa09..0011fc5 100644
fc9aca
--- a/clients/tui/nmt-connect-connection-list.c
fc9aca
+++ b/clients/tui/nmt-connect-connection-list.c
fc9aca
@@ -621,6 +621,7 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList  *list,
fc9aca
 	NmtConnectDevice *nmtdev;
fc9aca
 	NmtConnectConnection *nmtconn = NULL;
fc9aca
 	NMConnection *conn = NULL;
fc9aca
+	const char *iface = NULL;
fc9aca
 
fc9aca
 	g_return_val_if_fail (identifier, FALSE);
fc9aca
 
fc9aca
@@ -643,9 +644,12 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList  *list,
fc9aca
 				goto found;
fc9aca
 		}
fc9aca
 
fc9aca
-		if (!conn && nmtdev->device && !strcmp (identifier, nm_device_get_ip_iface (nmtdev->device))) {
fc9aca
-			nmtconn = nmtdev->conns->data;
fc9aca
-			goto found;
fc9aca
+		if (!conn && nmtdev->device) {
fc9aca
+			iface = nm_device_get_ip_iface (nmtdev->device);
fc9aca
+			if (iface && !strcmp (identifier, iface)) {
fc9aca
+				nmtconn = nmtdev->conns->data;
fc9aca
+				goto found;
fc9aca
+			}
fc9aca
 		}
fc9aca
 	}
fc9aca
 
fc9aca
-- 
fc9aca
2.9.4
fc9aca