[gnome-control-center: 9/14] network: Don't crash when showing active APs that are not valid UTF8
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center: 9/14] network: Don't crash when showing active APs that are not valid UTF8
- Date: Fri, 27 Jul 2012 15:23:30 +0000 (UTC)
commit a0f69c0809aff8c717b6d7548c280ec9c3e1af8c
Author: Richard Hughes <richard hughsie com>
Date: Thu Jul 26 14:46:53 2012 +0100
network: Don't crash when showing active APs that are not valid UTF8
There doesn't appear to be any standard saying you have to have ASCII/UTF-8
access point names...
panels/network/net-device-wifi.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index 068fa95..1c7e7d1 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -130,18 +130,20 @@ get_access_point_security (NMAccessPoint *ap)
static void
add_access_point (NetDeviceWifi *device_wifi, NMAccessPoint *ap, NMAccessPoint *active, NMDevice *device)
{
- NetDeviceWifiPrivate *priv = device_wifi->priv;
const GByteArray *ssid;
- const gchar *ssid_text;
const gchar *object_path;
+ const gchar *ssid_text;
+ gboolean is_active_ap;
+ gchar *title;
GtkListStore *liststore_network;
GtkTreeIter treeiter;
- gboolean is_active_ap;
+ NetDeviceWifiPrivate *priv = device_wifi->priv;
ssid = nm_access_point_get_ssid (ap);
if (ssid == NULL)
return;
ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
+ title = g_markup_escape_text (ssid_text, -1);
is_active_ap = active && nm_utils_same_ssid (ssid, nm_access_point_get_ssid (active), TRUE);
if (is_active_ap)
@@ -155,7 +157,7 @@ add_access_point (NetDeviceWifi *device_wifi, NMAccessPoint *ap, NMAccessPoint *
&treeiter,
-1,
COLUMN_ID, object_path,
- COLUMN_TITLE, ssid_text,
+ COLUMN_TITLE, title,
COLUMN_SORT, ssid_text,
COLUMN_STRENGTH, nm_access_point_get_strength (ap),
COLUMN_MODE, nm_access_point_get_mode (ap),
@@ -164,6 +166,7 @@ add_access_point (NetDeviceWifi *device_wifi, NMAccessPoint *ap, NMAccessPoint *
COLUMN_AP_IN_RANGE, TRUE,
COLUMN_AP_IS_SAVED, FALSE,
-1);
+ g_free (title);
// if (priv->arg_operation == OPERATION_CONNECT_8021X &&
// g_strcmp0(priv->arg_device, nm_object_get_path (NM_OBJECT (device))) == 0 &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]