[gnome-control-center] Network: prevent a possible crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Network: prevent a possible crash
- Date: Thu, 26 May 2011 21:17:10 +0000 (UTC)
commit b8529164d6278dbdeb420e2e843b3d72732c3efc
Author: Matthias Clasen <mclasen redhat com>
Date: Thu May 26 17:15:53 2011 -0400
Network: prevent a possible crash
Some of the settings may be NULL when we call is_hotspot_connection()
on random connections. No need to crash then...
panels/network/cc-network-panel.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 2d7e726..1e9af11 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -2656,18 +2656,18 @@ is_hotspot_connection (NMConnection *connection)
NMSettingIP4Config *sip;
sc = nm_connection_get_setting_connection (connection);
- if (strcmp (nm_setting_connection_get_connection_type (sc), "802-11-wireless") != 0) {
+ if (g_strcmp0 (nm_setting_connection_get_connection_type (sc), "802-11-wireless") != 0) {
return FALSE;
}
sw = nm_connection_get_setting_wireless (connection);
- if (strcmp (nm_setting_wireless_get_mode (sw), "adhoc") != 0) {
+ if (g_strcmp0 (nm_setting_wireless_get_mode (sw), "adhoc") != 0) {
return FALSE;
}
- if (strcmp (nm_setting_wireless_get_security (sw), "802-11-wireless-security") != 0) {
+ if (g_strcmp0 (nm_setting_wireless_get_security (sw), "802-11-wireless-security") != 0) {
return FALSE;
}
sip = nm_connection_get_setting_ip4_config (connection);
- if (strcmp (nm_setting_ip4_config_get_method (sip), "shared") != 0) {
+ if (g_strcmp0 (nm_setting_ip4_config_get_method (sip), "shared") != 0) {
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]