summaryrefslogtreecommitdiffstats
path: root/geoclue/geoclue-NMCrash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'geoclue/geoclue-NMCrash.patch')
-rw-r--r--geoclue/geoclue-NMCrash.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/geoclue/geoclue-NMCrash.patch b/geoclue/geoclue-NMCrash.patch
new file mode 100644
index 0000000..d2afc87
--- /dev/null
+++ b/geoclue/geoclue-NMCrash.patch
@@ -0,0 +1,31 @@
+From bcf9ee4f44625eddad4c267fedc507d9eeeaf3f4 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Tue, 29 Jun 2010 18:47:21 +0000
+Subject: Fix crasher when NetworkManager has no devices
+
+https://bugs.freedesktop.org/show_bug.cgi?id=28066
+---
+diff --git a/src/connectivity-networkmanager.c b/src/connectivity-networkmanager.c
+index 1061201..a7b8971 100644
+--- a/src/connectivity-networkmanager.c
++++ b/src/connectivity-networkmanager.c
+@@ -248,16 +248,12 @@ cache_ap_mac (GeoclueNetworkManager *self)
+ guint i;
+
+ devices = nm_client_get_devices (self->client);
+- if (devices == NULL) {
+- g_free (self->cache_ap_mac);
+- self->cache_ap_mac = NULL;
+- }
+
+ g_free (self->cache_ap_mac);
+ self->cache_ap_mac = NULL;
+ self->ap_strength = 0;
+
+- for (i = 0; i < devices->len; i++) {
++ for (i = 0; devices != NULL && i < devices->len; i++) {
+ NMDevice *device = g_ptr_array_index (devices, i);
+ if (NM_IS_DEVICE_WIFI (device)) {
+ get_best_ap (self, device);
+--
+cgit v0.8.3-6-g21f6