summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Lefebvre <a.lefebvre@outlook.fr>2017-05-30 13:45:32 +0200
committerThomas Haller <thaller@redhat.com>2017-05-30 14:46:53 +0200
commitcc36b9f6eb7870d02e0df7c26a7a980709b620fd (patch)
treeca5dc2e7339a81d163c0270675e8aeade36aaa20
parent47ebca23e3403243a97c1d0936f023a7c9f1ac38 (diff)
downloadNetworkManager-cc36b9f6eb7870d02e0df7c26a7a980709b620fd.tar.gz
nmtui connect: avoid segfault when iface is not found
https://github.com/NetworkManager/NetworkManager/pull/21 (cherry picked from commit 1fcbb69ae22ed4a6047e36c816f49b2a67a13583)
-rw-r--r--clients/tui/nmt-connect-connection-list.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c
index edfaa09b3d..0011fc5f38 100644
--- a/clients/tui/nmt-connect-connection-list.c
+++ b/clients/tui/nmt-connect-connection-list.c
@@ -621,6 +621,7 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList *list,
NmtConnectDevice *nmtdev;
NmtConnectConnection *nmtconn = NULL;
NMConnection *conn = NULL;
+ const char *iface = NULL;
g_return_val_if_fail (identifier, FALSE);
@@ -643,9 +644,12 @@ nmt_connect_connection_list_get_connection (NmtConnectConnectionList *list,
goto found;
}
- if (!conn && nmtdev->device && !strcmp (identifier, nm_device_get_ip_iface (nmtdev->device))) {
- nmtconn = nmtdev->conns->data;
- goto found;
+ if (!conn && nmtdev->device) {
+ iface = nm_device_get_ip_iface (nmtdev->device);
+ if (iface && !strcmp (identifier, iface)) {
+ nmtconn = nmtdev->conns->data;
+ goto found;
+ }
}
}