diff options
author | Kalev Lember <kalevlember@gmail.com> | 2013-09-11 16:12:49 +0200 |
---|---|---|
committer | Kalev Lember <kalevlember@gmail.com> | 2013-09-11 16:22:01 +0200 |
commit | f8f420256bfa4a589472536c09c867bd64847fb6 (patch) | |
tree | 4aa73da03eb7df6cfd67d3a4f807b1e1b308dc04 /panels/network/net-device-mobile.c | |
parent | 6192dd7fe344a1a80b5ec313ee86346cf3abbc01 (diff) | |
download | gnome-control-center-f8f420256bfa4a589472536c09c867bd64847fb6.tar.gz |
network: Fix a possible crash with no active connections
As a precaution, check the return value of get_active_connections to
avoid dereferencing a NULL pointer.
https://bugzilla.redhat.com/show_bug.cgi?id=990196
https://bugzilla.gnome.org/show_bug.cgi?id=707906
Diffstat (limited to 'panels/network/net-device-mobile.c')
-rw-r--r-- | panels/network/net-device-mobile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/panels/network/net-device-mobile.c b/panels/network/net-device-mobile.c index aafdc79e7..8e59cc9dd 100644 --- a/panels/network/net-device-mobile.c +++ b/panels/network/net-device-mobile.c @@ -469,7 +469,7 @@ device_off_toggled (GtkSwitch *sw, path = nm_connection_get_path (connection); client = net_object_get_client (NET_OBJECT (device_mobile)); acs = nm_client_get_active_connections (client); - for (i = 0; i < acs->len; i++) { + for (i = 0; acs && i < acs->len; i++) { a = (NMActiveConnection*)acs->pdata[i]; if (strcmp (nm_active_connection_get_connection (a), path) == 0) { nm_client_deactivate_connection (client, a); |