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...
This commit is contained in:
parent
f14b550144
commit
a0f69c0809
1 changed files with 7 additions and 4 deletions
|
@ -130,18 +130,20 @@ get_access_point_security (NMAccessPoint *ap)
|
||||||
static void
|
static void
|
||||||
add_access_point (NetDeviceWifi *device_wifi, NMAccessPoint *ap, NMAccessPoint *active, NMDevice *device)
|
add_access_point (NetDeviceWifi *device_wifi, NMAccessPoint *ap, NMAccessPoint *active, NMDevice *device)
|
||||||
{
|
{
|
||||||
NetDeviceWifiPrivate *priv = device_wifi->priv;
|
|
||||||
const GByteArray *ssid;
|
const GByteArray *ssid;
|
||||||
const gchar *ssid_text;
|
|
||||||
const gchar *object_path;
|
const gchar *object_path;
|
||||||
|
const gchar *ssid_text;
|
||||||
|
gboolean is_active_ap;
|
||||||
|
gchar *title;
|
||||||
GtkListStore *liststore_network;
|
GtkListStore *liststore_network;
|
||||||
GtkTreeIter treeiter;
|
GtkTreeIter treeiter;
|
||||||
gboolean is_active_ap;
|
NetDeviceWifiPrivate *priv = device_wifi->priv;
|
||||||
|
|
||||||
ssid = nm_access_point_get_ssid (ap);
|
ssid = nm_access_point_get_ssid (ap);
|
||||||
if (ssid == NULL)
|
if (ssid == NULL)
|
||||||
return;
|
return;
|
||||||
ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
|
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);
|
is_active_ap = active && nm_utils_same_ssid (ssid, nm_access_point_get_ssid (active), TRUE);
|
||||||
if (is_active_ap)
|
if (is_active_ap)
|
||||||
|
@ -155,7 +157,7 @@ add_access_point (NetDeviceWifi *device_wifi, NMAccessPoint *ap, NMAccessPoint *
|
||||||
&treeiter,
|
&treeiter,
|
||||||
-1,
|
-1,
|
||||||
COLUMN_ID, object_path,
|
COLUMN_ID, object_path,
|
||||||
COLUMN_TITLE, ssid_text,
|
COLUMN_TITLE, title,
|
||||||
COLUMN_SORT, ssid_text,
|
COLUMN_SORT, ssid_text,
|
||||||
COLUMN_STRENGTH, nm_access_point_get_strength (ap),
|
COLUMN_STRENGTH, nm_access_point_get_strength (ap),
|
||||||
COLUMN_MODE, nm_access_point_get_mode (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_IN_RANGE, TRUE,
|
||||||
COLUMN_AP_IS_SAVED, FALSE,
|
COLUMN_AP_IS_SAVED, FALSE,
|
||||||
-1);
|
-1);
|
||||||
|
g_free (title);
|
||||||
|
|
||||||
// if (priv->arg_operation == OPERATION_CONNECT_8021X &&
|
// if (priv->arg_operation == OPERATION_CONNECT_8021X &&
|
||||||
// g_strcmp0(priv->arg_device, nm_object_get_path (NM_OBJECT (device))) == 0 &&
|
// g_strcmp0(priv->arg_device, nm_object_get_path (NM_OBJECT (device))) == 0 &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue