From 77c10f94b6aa766e017bbf385bccbd7264c383fb Mon Sep 17 00:00:00 2001 From: Robert Love Date: Wed, 11 Jan 2006 21:48:39 +0000 Subject: [PATCH] 2006-01-11 Robert Love * gnome/applet/wireless-security-manager.c: Fix crash by not asserting that wso_foo_new() returned non-NULL. Instead, only append the new wso to wsm->options if the wso is non-NULL. The crux is that we assume that the relevant key types are implied by WEP and WPA as appropriate. To be sure, they should be, but we should not expect drivers to not be oozing piles of wolf fecal matter. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1319 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 9 +++++++++ gnome/applet/wireless-security-manager.c | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4d73e6b0b..e1ade59606 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-01-11 Robert Love + + * gnome/applet/wireless-security-manager.c: Fix crash by not asserting + that wso_foo_new() returned non-NULL. Instead, only append the new + wso to wsm->options if the wso is non-NULL. The crux is that we + assume that the relevant key types are implied by WEP and WPA as + appropriate. To be sure, they should be, but we should not expect + drivers to not be oozing piles of wolf fecal matter. + 2006-01-11 Robert Love * configure.in: Add the gcc flags '-Wshadow' and '-Wfloat-equal'. diff --git a/gnome/applet/wireless-security-manager.c b/gnome/applet/wireless-security-manager.c index 66ac1b6725..46b344a452 100644 --- a/gnome/applet/wireless-security-manager.c +++ b/gnome/applet/wireless-security-manager.c @@ -70,35 +70,35 @@ void wsm_set_capabilities (WirelessSecurityManager *wsm, guint32 capabilities) if (capabilities & NM_802_11_CAP_PROTO_NONE) { opt = wso_none_new (wsm->glade_file); - g_assert (opt); - wsm->options = g_slist_append (wsm->options, opt); + if (opt) + wsm->options = g_slist_append (wsm->options, opt); } if (capabilities & NM_802_11_CAP_PROTO_WEP) { opt = wso_wep_passphrase_new (wsm->glade_file); - g_assert (opt); - wsm->options = g_slist_append (wsm->options, opt); + if (opt) + wsm->options = g_slist_append (wsm->options, opt); opt = wso_wep_hex_new (wsm->glade_file); - g_assert (opt); - wsm->options = g_slist_append (wsm->options, opt); + if (opt) + wsm->options = g_slist_append (wsm->options, opt); opt = wso_wep_ascii_new (wsm->glade_file); - g_assert (opt); - wsm->options = g_slist_append (wsm->options, opt); + if (opt) + wsm->options = g_slist_append (wsm->options, opt); } if ( (capabilities & NM_802_11_CAP_PROTO_WPA) || (capabilities & NM_802_11_CAP_PROTO_WPA2)) { opt = wso_wpa_psk_passphrase_new (wsm->glade_file, capabilities); - g_assert (opt); - wsm->options = g_slist_append (wsm->options, opt); + if (opt) + wsm->options = g_slist_append (wsm->options, opt); opt = wso_wpa_psk_hex_new (wsm->glade_file, capabilities); - g_assert (opt); - wsm->options = g_slist_append (wsm->options, opt); + if (opt) + wsm->options = g_slist_append (wsm->options, opt); } }