[gnome-control-center/gnome-3-4] network: don't crash on hidden SSIDs
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-4] network: don't crash on hidden SSIDs
- Date: Thu, 29 Nov 2012 10:21:42 +0000 (UTC)
commit 104948be6bea001972c46a8c422d307f21218ba3
Author: Dan Williams <dcbw redhat com>
Date: Fri Apr 20 11:48:17 2012 -0500
network: don't crash on hidden SSIDs
APs that don't broadcast their SSID will return NULL from
nm_access_point_get_ssid() (since that's easier to check in C
using an if statement than returning a zero-length GByteArray).
Thus the code shouldn't try to dereference the SSID byte array
since it could be NULL.
But in fact, the panel shouldn't be showing hidden APs anywhere
in the UI, since the user needs to manually enter the SSID to
connect to it anyway. So just ignore hidden APs like nm-applet
does.
Signed-off-by: Dan Williams <dcbw redhat com>
https://bugzilla.gnome.org/show_bug.cgi?id=672922
panels/network/cc-network-panel.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 7018a28..b673597 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -1114,13 +1114,19 @@ panel_get_strongest_unique_aps (const GPtrArray *aps)
if (aps != NULL)
for (i = 0; i < aps->len; i++) {
ap = NM_ACCESS_POINT (g_ptr_array_index (aps, i));
+
+ /* Hidden SSIDs don't get shown in the list */
ssid = nm_access_point_get_ssid (ap);
+ if (!ssid)
+ continue;
+
add_ap = TRUE;
/* get already added list */
for (j=0; j<aps_unique->len; j++) {
ap_tmp = NM_ACCESS_POINT (g_ptr_array_index (aps_unique, j));
ssid_tmp = nm_access_point_get_ssid (ap_tmp);
+ g_assert (ssid_tmp);
/* is this the same type and data? */
if (nm_utils_same_ssid (ssid, ssid_tmp, TRUE)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]